Changeset 28907 in webkit
- Timestamp:
- Dec 20, 2007 1:57:18 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSContextRef.cpp
r28899 r28907 32 32 #include "JSClassRef.h" 33 33 #include "JSGlobalObject.h" 34 #include "completion.h"35 34 #include "object.h" 36 35 #include <wtf/Platform.h> -
trunk/JavaScriptCore/ChangeLog
r28899 r28907 1 2007-12-20 Darin Adler <darin@apple.com> 2 3 - re-fix http://bugs.webkit.org/show_bug.cgi?id=16471 4 Completions need to be smaller (or not exist at all) 5 6 Same patch as last time with the test failures problem fixed. 7 8 * kjs/function.cpp: 9 (KJS::GlobalFuncImp::callAsFunction): Make sure to check the completion 10 type from newExec to see if the execute raised an exception. 11 1 12 2007-12-20 Darin Adler <darin@apple.com> 2 13 -
trunk/JavaScriptCore/bindings/runtime_method.cpp
r28899 r28907 93 93 return aValue; 94 94 } 95 96 Completion RuntimeMethod::execute(ExecState*)97 {98 return Completion(Normal, jsUndefined());99 } -
trunk/JavaScriptCore/bindings/runtime_method.h
r28899 r28907 33 33 namespace KJS { 34 34 35 36 class RuntimeMethod : public InternalFunctionImp 37 { 35 class RuntimeMethod : public InternalFunctionImp { 38 36 public: 39 37 RuntimeMethod(ExecState *exec, const Identifier &n, Bindings::MethodList &methodList); … … 42 40 43 41 virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args); 44 45 virtual Completion execute(ExecState *exec);46 42 47 43 private: -
trunk/JavaScriptCore/kjs/ExecState.h
r28899 r28907 109 109 110 110 LocalStorage& localStorage() { return *m_localStorage; } 111 111 112 // These are only valid right after calling execute(). 113 ComplType completionType() const { return m_completionType; } 114 const Identifier& breakOrContinueTarget() const 115 { 116 ASSERT(m_completionType == Break || m_completionType == Continue); 117 return *m_breakOrContinueTarget; 118 } 119 120 // Only for use in the implementation of execute(). 121 void setCompletionType(ComplType type) 122 { 123 ASSERT(type != Break); 124 ASSERT(type != Continue); 125 m_completionType = type; 126 } 127 JSValue* setNormalCompletion() 128 { 129 ASSERT(!hadException()); 130 m_completionType = Normal; 131 return 0; 132 } 133 JSValue* setNormalCompletion(JSValue* value) 134 { 135 ASSERT(!hadException()); 136 m_completionType = Normal; 137 return value; 138 } 139 JSValue* setBreakCompletion(const Identifier* target) 140 { 141 ASSERT(!hadException()); 142 m_completionType = Break; 143 m_breakOrContinueTarget = target; 144 return 0; 145 } 146 JSValue* setContinueCompletion(const Identifier* target) 147 { 148 ASSERT(!hadException()); 149 m_completionType = Continue; 150 m_breakOrContinueTarget = target; 151 return 0; 152 } 153 JSValue* setReturnValueCompletion(JSValue* returnValue) 154 { 155 ASSERT(!hadException()); 156 ASSERT(returnValue); 157 m_completionType = ReturnValue; 158 return returnValue; 159 } 160 JSValue* setThrowCompletion(JSValue* exception) 161 { 162 ASSERT(!hadException()); 163 ASSERT(exception); 164 m_completionType = Throw; 165 return exception; 166 } 167 JSValue* setInterruptedCompletion() 168 { 169 ASSERT(!hadException()); 170 m_completionType = Interrupted; 171 return 0; 172 } 173 112 174 public: 113 175 ExecState(JSGlobalObject* glob, JSObject* thisV, … … 142 204 int m_switchDepth; 143 205 CodeType m_codeType; 206 207 ComplType m_completionType; 208 const Identifier* m_breakOrContinueTarget; 144 209 }; 145 210 -
trunk/JavaScriptCore/kjs/completion.h
r28899 r28907 27 27 namespace KJS { 28 28 29 class Identifier;30 29 class JSValue; 31 30 … … 45 44 public: 46 45 Completion(ComplType type = Normal, JSValue* value = 0) 47 : m_type(type), m_value(value), m_target(0) { } 48 Completion(ComplType type, const Identifier* target) 49 : m_type(type), m_value(0), m_target(target) { } 46 : m_type(type), m_value(value) { } 50 47 51 48 ComplType complType() const { return m_type; } 52 49 JSValue* value() const { return m_value; } 53 50 void setValue(JSValue* v) { m_value = v; } 54 const Identifier& target() const { return *m_target; }55 51 bool isValueCompletion() const { return !!m_value; } 56 52 … … 58 54 ComplType m_type; 59 55 JSValue* m_value; 60 const Identifier* m_target;61 56 }; 62 57 -
trunk/JavaScriptCore/kjs/date_object.h
r28899 r28907 133 133 virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args); 134 134 135 Completion execute(const List &);136 135 JSObject *construct(const List &); 137 136 }; -
trunk/JavaScriptCore/kjs/function.cpp
r28899 r28907 71 71 JSValue* FunctionImp::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args) 72 72 { 73 // enter a new execution context 74 ExecState newExec(exec->dynamicGlobalObject(), thisObj, body.get(), FunctionCode, exec, exec->dynamicGlobalObject()->currentExec(), this, &args); 75 if (exec->hadException()) 76 newExec.setException(exec->exception()); 77 78 Completion comp = execute(&newExec); 79 80 // if an exception occured, propogate it back to the previous execution object 81 if (newExec.hadException()) 82 comp = Completion(Throw, newExec.exception()); 83 84 if (comp.complType() == Throw) { 85 exec->setException(comp.value()); 86 return comp.value(); 87 } 88 else if (comp.complType() == ReturnValue) 89 return comp.value(); 90 else 73 ExecState newExec(exec->dynamicGlobalObject(), thisObj, body.get(), FunctionCode, exec, exec->dynamicGlobalObject()->currentExec(), this, &args); 74 JSValue* result = body->execute(&newExec); 75 if (newExec.completionType() == Throw) { 76 exec->setException(result); 77 return result; 78 } 79 if (newExec.completionType() == ReturnValue) 80 return result; 91 81 return jsUndefined(); 92 82 } … … 213 203 else 214 204 return obj; 215 }216 217 Completion FunctionImp::execute(ExecState* exec)218 {219 Completion result = body->execute(exec);220 221 if (result.complType() == Throw || result.complType() == ReturnValue)222 return result;223 return Completion(Normal, jsUndefined()); // TODO: or ReturnValue ?224 205 } 225 206 … … 719 700 JSObject* thisVal = static_cast<JSObject*>(exec->thisValue()); 720 701 ExecState newExec(globalObject, thisVal, evalNode.get(), EvalCode, exec, globalObject->currentExec()); 721 if (exec->hadException())722 newExec.setException(exec->exception());723 702 724 703 if (switchGlobal) { … … 726 705 newExec.setVariableObject(static_cast<JSGlobalObject*>(thisObj)); 727 706 } 728 729 Completion c = evalNode->execute(&newExec); 730 707 JSValue* value = evalNode->execute(&newExec); 731 708 if (switchGlobal) 732 709 newExec.popScope(); 733 710 734 // if an exception occured, propogate it back to the previous execution object 735 if (newExec.hadException()) 736 exec->setException(newExec.exception()); 737 738 res = jsUndefined(); 739 if (c.complType() == Throw) 740 exec->setException(c.value()); 741 else if (c.isValueCompletion()) 742 res = c.value(); 711 if (newExec.completionType() == Throw) { 712 exec->setException(value); 713 return value; 714 } 715 return value ? value : jsUndefined(); 743 716 } 744 break;745 717 } 746 718 case ParseInt: -
trunk/JavaScriptCore/kjs/function.h
r28899 r28907 83 83 84 84 virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List& args); 85 Completion execute(ExecState*);86 85 87 86 // Note: unlike body->paramName, this returns Identifier::null for parameters -
trunk/JavaScriptCore/kjs/interpreter.cpp
r28899 r28907 121 121 // execute the code 122 122 ExecState newExec(globalObject, thisObj, progNode.get()); 123 res = progNode->execute(&newExec); 123 JSValue* value = progNode->execute(&newExec); 124 res = Completion(newExec.completionType(), value); 124 125 } 125 126 -
trunk/JavaScriptCore/kjs/nodes.cpp
r28899 r28907 47 47 #define KJS_BREAKPOINT \ 48 48 if (Debugger::debuggersPresent > 0 && !hitStatement(exec)) \ 49 return Completion(Normal);49 return 0; 50 50 51 51 #define KJS_CHECKEXCEPTION \ … … 272 272 } 273 273 274 Completion Node::createErrorCompletion(ExecState* exec, ErrorType e, const char *msg)275 { 276 return Completion(Throw,Error::create(exec, e, msg, lineNo(), currentSourceId(exec), currentSourceURL(exec)));277 } 278 279 Completion Node::createErrorCompletion(ExecState *exec, ErrorType e, const char *msg, const Identifier &ident)274 JSValue* Node::setErrorCompletion(ExecState* exec, ErrorType e, const char* msg) 275 { 276 return exec->setThrowCompletion(Error::create(exec, e, msg, lineNo(), currentSourceId(exec), currentSourceURL(exec))); 277 } 278 279 JSValue* Node::setErrorCompletion(ExecState* exec, ErrorType e, const char* msg, const Identifier& ident) 280 280 { 281 281 UString message = msg; 282 282 substitute(message, ident.ustring()); 283 return Completion(Throw,Error::create(exec, e, message, lineNo(), currentSourceId(exec), currentSourceURL(exec)));283 return exec->setThrowCompletion(Error::create(exec, e, message, lineNo(), currentSourceId(exec), currentSourceURL(exec))); 284 284 } 285 285 … … 365 365 } 366 366 367 CompletionNode::rethrowException(ExecState* exec)367 JSValue* Node::rethrowException(ExecState* exec) 368 368 { 369 369 JSValue* exception = exec->exception(); 370 370 exec->clearException(); 371 371 handleException(exec, exception); 372 return Completion(Throw,exception);372 return exec->setThrowCompletion(exception); 373 373 } 374 374 … … 387 387 } 388 388 389 // return true if the debugger wants us to stop at this point 389 // Set normal completion and return false if the debugger wants us to stop at this point. 390 // FIXME: This seems like poor naming and strange design. Why false to stop? Why "hit statement"? 390 391 bool StatementNode::hitStatement(ExecState* exec) 391 392 { 392 Debugger *dbg= exec->dynamicGlobalObject()->debugger();393 if (dbg)394 return dbg->atStatement(exec, currentSourceId(exec), firstLine(), lastLine());395 else396 return true; // continue393 Debugger* debugger = exec->dynamicGlobalObject()->debugger(); 394 if (!debugger || debugger->atStatement(exec, currentSourceId(exec), firstLine(), lastLine())) 395 return true; 396 exec->setCompletionType(Normal); 397 return false; 397 398 } 398 399 … … 3549 3550 3550 3551 // ECMA 12.2 3551 Completion VarStatementNode::execute(ExecState *exec)3552 { 3553 KJS_BREAKPOINT ;3552 JSValue* VarStatementNode::execute(ExecState* exec) 3553 { 3554 KJS_BREAKPOINT 3554 3555 3555 3556 next->evaluate(exec); 3556 3557 KJS_CHECKEXCEPTION 3557 3558 3558 return Completion(Normal);3559 return exec->setNormalCompletion(); 3559 3560 } 3560 3561 … … 3588 3589 } 3589 3590 3590 static inline Completion statementListExecute(SourceElements& statements, ExecState* exec) 3591 { 3592 JSValue* v = 0; 3593 Completion c(Normal); 3594 const SourceElements::iterator end = statements.end(); 3595 for (SourceElements::iterator ptr = statements.begin(); ptr != end; ++ptr) { 3596 c = (*ptr)->execute(exec); 3597 3598 if (JSValue* v2 = c.value()) 3599 v = v2; 3600 c.setValue(v); 3601 3602 if (c.complType() != Normal) 3603 return c; 3604 } 3605 return c; 3606 } 3607 3591 static inline JSValue* statementListExecute(SourceElements& statements, ExecState* exec) 3592 { 3593 JSValue* value = 0; 3594 size_t size = statements.size(); 3595 for (size_t i = 0; i != size; ++i) { 3596 JSValue* statementValue = statements[i]->execute(exec); 3597 if (exec->completionType() != Normal) 3598 return statementValue; 3599 if (statementValue) 3600 value = statementValue; 3601 } 3602 return exec->setNormalCompletion(value); 3603 } 3604 3608 3605 // ------------------------------ BlockNode ------------------------------------ 3609 3606 … … 3620 3617 3621 3618 // ECMA 12.1 3622 Completion BlockNode::execute(ExecState *exec)3619 JSValue* BlockNode::execute(ExecState* exec) 3623 3620 { 3624 3621 return statementListExecute(*m_children, exec); … … 3628 3625 3629 3626 // ECMA 12.3 3630 Completion EmptyStatementNode::execute(ExecState *)3631 { 3632 return Completion(Normal);3627 JSValue* EmptyStatementNode::execute(ExecState* exec) 3628 { 3629 return exec->setNormalCompletion(); 3633 3630 } 3634 3631 … … 3642 3639 3643 3640 // ECMA 12.4 3644 Completion ExprStatementNode::execute(ExecState *exec)3645 { 3646 KJS_BREAKPOINT;3647 3648 JSValue *v= expr->evaluate(exec);3649 KJS_CHECKEXCEPTION3650 3651 return Completion(Normal, v);3641 JSValue* ExprStatementNode::execute(ExecState* exec) 3642 { 3643 KJS_BREAKPOINT 3644 3645 JSValue* value = expr->evaluate(exec); 3646 KJS_CHECKEXCEPTION 3647 3648 return exec->setNormalCompletion(value); 3652 3649 } 3653 3650 … … 3665 3662 3666 3663 // ECMA 12.5 3667 CompletionIfNode::execute(ExecState* exec)3668 { 3669 KJS_BREAKPOINT ;3664 JSValue* IfNode::execute(ExecState* exec) 3665 { 3666 KJS_BREAKPOINT 3670 3667 3671 3668 bool b = expr->evaluateToBoolean(exec); … … 3678 3675 // no else 3679 3676 if (!statement2) 3680 return Completion(Normal);3677 return exec->setNormalCompletion(); 3681 3678 3682 3679 // else … … 3693 3690 3694 3691 // ECMA 12.6.1 3695 Completion DoWhileNode::execute(ExecState *exec)3696 { 3697 KJS_BREAKPOINT ;3692 JSValue* DoWhileNode::execute(ExecState* exec) 3693 { 3694 KJS_BREAKPOINT 3698 3695 3699 3696 JSValue* value = 0; … … 3701 3698 while (1) { 3702 3699 exec->pushIteration(); 3703 Completion c= statement->execute(exec);3700 JSValue* statementValue = statement->execute(exec); 3704 3701 exec->popIteration(); 3705 3702 3706 3703 if (exec->dynamicGlobalObject()->timedOut()) 3707 return Completion(Interrupted); 3708 3709 if (c.isValueCompletion()) 3710 value = c.value(); 3711 3712 if (!((c.complType() == Continue) && ls.contains(c.target()))) { 3713 if ((c.complType() == Break) && ls.contains(c.target())) 3714 return Completion(Normal, value); 3715 if (c.complType() != Normal) 3716 return c; 3704 exec->setInterruptedCompletion(); 3705 3706 if (statementValue) 3707 value = statementValue; 3708 3709 if (exec->completionType() != Normal) { 3710 if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget())) 3711 goto continueDoWhileLoop; 3712 if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget())) 3713 break; 3714 return statementValue; 3717 3715 } 3718 3716 3717 continueDoWhileLoop: 3719 3718 bool b = expr->evaluateToBoolean(exec); 3720 3719 KJS_CHECKEXCEPTION 3721 3720 if (!b) 3722 return Completion(Normal, value);3723 } 3724 3725 return Completion(); // work around gcc 4.0 bug3721 break; 3722 } 3723 3724 return exec->setNormalCompletion(value); 3726 3725 } 3727 3726 … … 3735 3734 3736 3735 // ECMA 12.6.2 3737 Completion WhileNode::execute(ExecState *exec)3738 { 3739 KJS_BREAKPOINT ;3736 JSValue* WhileNode::execute(ExecState* exec) 3737 { 3738 KJS_BREAKPOINT 3740 3739 3741 3740 JSValue* value = 0; … … 3745 3744 KJS_CHECKEXCEPTION 3746 3745 if (!b) 3747 return Completion(Normal, value);3746 break; 3748 3747 3749 3748 exec->pushIteration(); 3750 Completion c= statement->execute(exec);3749 JSValue* statementValue = statement->execute(exec); 3751 3750 exec->popIteration(); 3752 3751 3753 3752 if (exec->dynamicGlobalObject()->timedOut()) 3754 return Completion(Interrupted); 3755 3756 if (c.isValueCompletion()) 3757 value = c.value(); 3758 3759 if ((c.complType() == Continue) && ls.contains(c.target())) 3760 continue; 3761 if ((c.complType() == Break) && ls.contains(c.target())) 3762 return Completion(Normal, value); 3763 if (c.complType() != Normal) 3764 return c; 3765 } 3766 3767 return Completion(); // work around gcc 4.0 bug 3753 return exec->setInterruptedCompletion(); 3754 3755 if (statementValue) 3756 value = statementValue; 3757 3758 if (exec->completionType() != Normal) { 3759 if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget())) 3760 continue; 3761 if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget())) 3762 break; 3763 return statementValue; 3764 } 3765 } 3766 3767 return exec->setNormalCompletion(value); 3768 3768 } 3769 3769 … … 3782 3782 3783 3783 // ECMA 12.6.3 3784 CompletionForNode::execute(ExecState *exec)3785 { 3786 JSValue* cval= 0;3784 JSValue* ForNode::execute(ExecState *exec) 3785 { 3786 JSValue* value = 0; 3787 3787 3788 3788 if (expr1) { … … 3796 3796 KJS_CHECKEXCEPTION 3797 3797 if (!b) 3798 return Completion(Normal, cval);3798 break; 3799 3799 } 3800 3800 3801 3801 exec->pushIteration(); 3802 Completion c= statement->execute(exec);3802 JSValue* statementValue = statement->execute(exec); 3803 3803 exec->popIteration(); 3804 if (c.isValueCompletion()) 3805 cval = c.value(); 3806 if (!((c.complType() == Continue) && ls.contains(c.target()))) { 3807 if ((c.complType() == Break) && ls.contains(c.target())) 3808 return Completion(Normal, cval); 3809 if (c.complType() != Normal) 3810 return c; 3804 if (statementValue) 3805 value = statementValue; 3806 3807 if (exec->dynamicGlobalObject()->timedOut()) 3808 return exec->setInterruptedCompletion(); 3809 3810 if (exec->completionType() != Normal) { 3811 if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget())) 3812 goto continueForLoop; 3813 if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget())) 3814 break; 3815 return statementValue; 3811 3816 } 3812 3817 3813 if (exec->dynamicGlobalObject()->timedOut()) 3814 return Completion(Interrupted); 3815 3818 continueForLoop: 3816 3819 if (expr3) { 3817 3820 expr3->evaluate(exec); … … 3820 3823 } 3821 3824 3822 return Completion(); // work around gcc 4.0 bug3825 return exec->setNormalCompletion(value); 3823 3826 } 3824 3827 … … 3848 3851 3849 3852 // ECMA 12.6.4 3850 Completion ForInNode::execute(ExecState *exec) 3851 { 3852 JSValue *e; 3853 JSValue *retval = 0; 3854 JSObject *v; 3855 Completion c; 3856 PropertyNameArray propertyNames; 3853 JSValue* ForInNode::execute(ExecState* exec) 3854 { 3855 JSValue* value = 0; 3857 3856 3858 3857 if (varDecl) { … … 3861 3860 } 3862 3861 3863 e = expr->evaluate(exec); 3864 3865 // for Null and Undefined, we want to make sure not to go through 3866 // the loop at all, because their object wrappers will have a 3867 // property list but will throw an exception if you attempt to 3868 // access any property. 3862 JSValue* e = expr->evaluate(exec); 3863 3864 // For Null and Undefined, we want to make sure not to go through 3865 // the loop at all, because toObject will throw an exception. 3869 3866 if (e->isUndefinedOrNull()) 3870 return Completion(Normal);3867 return exec->setNormalCompletion(); 3871 3868 3872 3869 KJS_CHECKEXCEPTION 3873 v = e->toObject(exec); 3870 JSObject* v = e->toObject(exec); 3871 PropertyNameArray propertyNames; 3874 3872 v->getPropertyNames(exec, propertyNames); 3875 3873 3876 3874 PropertyNameArray::const_iterator end = propertyNames.end(); 3877 3875 for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != end; ++it) { 3878 const Identifier &name = *it;3876 const Identifier& name = *it; 3879 3877 if (!v->hasProperty(exec, name)) 3880 3878 continue; … … 3929 3927 3930 3928 exec->pushIteration(); 3931 c= statement->execute(exec);3929 JSValue* statementValue = statement->execute(exec); 3932 3930 exec->popIteration(); 3933 if ( c.isValueCompletion())3934 retval = c.value();3935 3936 if ( !((c.complType() == Continue) && ls.contains(c.target()))) {3937 if ((c.complType() == Break) && ls.contains(c.target()))3938 break;3939 if (c.complType() != Normal) {3940 return c;3941 }3931 if (statementValue) 3932 value = statementValue; 3933 3934 if (exec->completionType() != Normal) { 3935 if (exec->completionType() == Continue && ls.contains(exec->breakOrContinueTarget())) 3936 continue; 3937 if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget())) 3938 break; 3939 return statementValue; 3942 3940 } 3943 3941 } 3944 3942 3945 return Completion(Normal, retval);3943 return exec->setNormalCompletion(value); 3946 3944 } 3947 3945 … … 3949 3947 3950 3948 // ECMA 12.7 3951 Completion ContinueNode::execute(ExecState *exec)3952 { 3953 KJS_BREAKPOINT ;3949 JSValue* ContinueNode::execute(ExecState* exec) 3950 { 3951 KJS_BREAKPOINT 3954 3952 3955 3953 if (ident.isEmpty() && !exec->inIteration()) 3956 return createErrorCompletion(exec, SyntaxError, "Invalid continue statement.");3954 return setErrorCompletion(exec, SyntaxError, "Invalid continue statement."); 3957 3955 if (!ident.isEmpty() && !exec->seenLabels()->contains(ident)) 3958 return createErrorCompletion(exec, SyntaxError, "Label %s not found.", ident);3959 return Completion(Continue,&ident);3956 return setErrorCompletion(exec, SyntaxError, "Label %s not found.", ident); 3957 return exec->setContinueCompletion(&ident); 3960 3958 } 3961 3959 … … 3963 3961 3964 3962 // ECMA 12.8 3965 Completion BreakNode::execute(ExecState *exec) 3966 { 3967 KJS_BREAKPOINT; 3968 3969 if (ident.isEmpty() && !exec->inIteration() && 3970 !exec->inSwitch()) 3971 return createErrorCompletion(exec, SyntaxError, "Invalid break statement."); 3963 JSValue* BreakNode::execute(ExecState *exec) 3964 { 3965 KJS_BREAKPOINT 3966 3967 if (ident.isEmpty() && !exec->inIteration() && !exec->inSwitch()) 3968 return setErrorCompletion(exec, SyntaxError, "Invalid break statement."); 3972 3969 if (!ident.isEmpty() && !exec->seenLabels()->contains(ident)) 3973 return createErrorCompletion(exec, SyntaxError, "Label %s not found.");3974 return Completion(Break,&ident);3970 return setErrorCompletion(exec, SyntaxError, "Label %s not found."); 3971 return exec->setBreakCompletion(&ident); 3975 3972 } 3976 3973 … … 3984 3981 3985 3982 // ECMA 12.9 3986 Completion ReturnNode::execute(ExecState *exec)3987 { 3988 KJS_BREAKPOINT ;3983 JSValue* ReturnNode::execute(ExecState* exec) 3984 { 3985 KJS_BREAKPOINT 3989 3986 3990 3987 CodeType codeType = exec->codeType(); 3991 3988 if (codeType != FunctionCode) 3992 return createErrorCompletion(exec, SyntaxError, "Invalid return statement.");3989 return setErrorCompletion(exec, SyntaxError, "Invalid return statement."); 3993 3990 3994 3991 if (!value) 3995 return Completion(ReturnValue,jsUndefined());3996 3997 JSValue *v = value->evaluate(exec);3992 return exec->setReturnValueCompletion(jsUndefined()); 3993 3994 JSValue* v = value->evaluate(exec); 3998 3995 KJS_CHECKEXCEPTION 3999 3996 4000 return Completion(ReturnValue,v);3997 return exec->setReturnValueCompletion(v); 4001 3998 } 4002 3999 … … 4010 4007 4011 4008 // ECMA 12.10 4012 CompletionWithNode::execute(ExecState *exec)4013 { 4014 KJS_BREAKPOINT ;4009 JSValue* WithNode::execute(ExecState *exec) 4010 { 4011 KJS_BREAKPOINT 4015 4012 4016 4013 JSValue *v = expr->evaluate(exec); … … 4019 4016 KJS_CHECKEXCEPTION 4020 4017 exec->pushScope(o); 4021 Completion res= statement->execute(exec);4018 JSValue* value = statement->execute(exec); 4022 4019 exec->popScope(); 4023 4020 4024 return res;4021 return value; 4025 4022 } 4026 4023 … … 4045 4042 4046 4043 // ECMA 12.11 4047 Completion CaseClauseNode::evalStatements(ExecState *exec)4044 JSValue* CaseClauseNode::executeStatements(ExecState* exec) 4048 4045 { 4049 4046 if (m_children) 4050 4047 return statementListExecute(*m_children, exec); 4051 else 4052 return Completion(Normal, jsUndefined()); 4048 return exec->setNormalCompletion(); 4053 4049 } 4054 4050 … … 4082 4078 4083 4079 // ECMA 12.11 4084 Completion CaseBlockNode::evalBlock(ExecState *exec, JSValue *input) 4085 { 4086 JSValue *v; 4087 Completion res; 4088 ClauseListNode *a = list1.get(); 4089 ClauseListNode *b = list2.get(); 4090 CaseClauseNode *clause; 4091 4080 JSValue* CaseBlockNode::executeBlock(ExecState* exec, JSValue* input) 4081 { 4082 ClauseListNode* a = list1.get(); 4092 4083 while (a) { 4093 clause = a->getClause();4084 CaseClauseNode* clause = a->getClause(); 4094 4085 a = a->getNext(); 4095 v = clause->evaluate(exec);4086 JSValue* v = clause->evaluate(exec); 4096 4087 KJS_CHECKEXCEPTION 4097 4088 if (strictEqual(exec, input, v)) { 4098 res = clause->evalStatements(exec);4099 if ( res.complType() != Normal)4089 JSValue* res = clause->executeStatements(exec); 4090 if (exec->completionType() != Normal) 4100 4091 return res; 4101 while (a) {4102 res = a->getClause()->evalStatements(exec);4103 if ( res.complType() != Normal)4092 for (; a; a = a->getNext()) { 4093 JSValue* res = a->getClause()->executeStatements(exec); 4094 if (exec->completionType() != Normal) 4104 4095 return res; 4105 a = a->getNext();4106 4096 } 4107 4097 break; … … 4109 4099 } 4110 4100 4101 ClauseListNode* b = list2.get(); 4111 4102 while (b) { 4112 clause = b->getClause();4103 CaseClauseNode* clause = b->getClause(); 4113 4104 b = b->getNext(); 4114 v = clause->evaluate(exec);4105 JSValue* v = clause->evaluate(exec); 4115 4106 KJS_CHECKEXCEPTION 4116 4107 if (strictEqual(exec, input, v)) { 4117 res = clause->evalStatements(exec);4118 if ( res.complType() != Normal)4108 JSValue* res = clause->executeStatements(exec); 4109 if (exec->completionType() != Normal) 4119 4110 return res; 4120 4111 goto step18; … … 4124 4115 // default clause 4125 4116 if (def) { 4126 res = def->evalStatements(exec);4127 if ( res.complType() != Normal)4117 JSValue* res = def->executeStatements(exec); 4118 if (exec->completionType() != Normal) 4128 4119 return res; 4129 4120 } … … 4131 4122 step18: 4132 4123 while (b) { 4133 clause = b->getClause();4134 res = clause->evalStatements(exec);4135 if ( res.complType() != Normal)4124 CaseClauseNode* clause = b->getClause(); 4125 JSValue* res = clause->executeStatements(exec); 4126 if (exec->completionType() != Normal) 4136 4127 return res; 4137 4128 b = b->getNext(); … … 4141 4132 KJS_CHECKEXCEPTION 4142 4133 4143 return Completion(Normal);4134 return exec->setNormalCompletion(); 4144 4135 } 4145 4136 … … 4153 4144 4154 4145 // ECMA 12.11 4155 Completion SwitchNode::execute(ExecState *exec)4156 { 4157 KJS_BREAKPOINT ;4146 JSValue* SwitchNode::execute(ExecState* exec) 4147 { 4148 KJS_BREAKPOINT 4158 4149 4159 4150 JSValue *v = expr->evaluate(exec); … … 4161 4152 4162 4153 exec->pushSwitch(); 4163 Completion res = block->evalBlock(exec,v);4154 JSValue* result = block->executeBlock(exec, v); 4164 4155 exec->popSwitch(); 4165 4156 4166 if ( (res.complType() == Break) && ls.contains(res.target()))4167 return Completion(Normal, res.value());4168 return res ;4157 if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget())) 4158 exec->setCompletionType(Normal); 4159 return result; 4169 4160 } 4170 4161 … … 4177 4168 4178 4169 // ECMA 12.12 4179 CompletionLabelNode::execute(ExecState *exec)4170 JSValue* LabelNode::execute(ExecState *exec) 4180 4171 { 4181 4172 if (!exec->seenLabels()->push(label)) 4182 return createErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label);4183 Completion e= statement->execute(exec);4173 return setErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label); 4174 JSValue* result = statement->execute(exec); 4184 4175 exec->seenLabels()->pop(); 4185 4176 4186 if ( (e.complType() == Break) && (e.target() == label))4187 return Completion(Normal, e.value());4188 return e;4177 if (exec->completionType() == Break && exec->breakOrContinueTarget() == label) 4178 exec->setCompletionType(Normal); 4179 return result; 4189 4180 } 4190 4181 … … 4197 4188 4198 4189 // ECMA 12.13 4199 Completion ThrowNode::execute(ExecState *exec)4200 { 4201 KJS_BREAKPOINT ;4190 JSValue* ThrowNode::execute(ExecState* exec) 4191 { 4192 KJS_BREAKPOINT 4202 4193 4203 4194 JSValue *v = expr->evaluate(exec); … … 4205 4196 4206 4197 handleException(exec, v); 4207 return Completion(Throw,v);4198 return exec->setThrowCompletion(v); 4208 4199 } 4209 4200 … … 4219 4210 4220 4211 // ECMA 12.14 4221 CompletionTryNode::execute(ExecState *exec)4222 { 4223 KJS_BREAKPOINT ;4224 4225 Completion c= tryBlock->execute(exec);4212 JSValue* TryNode::execute(ExecState *exec) 4213 { 4214 KJS_BREAKPOINT 4215 4216 JSValue* result = tryBlock->execute(exec); 4226 4217 4227 4218 if (Collector::isOutOfMemory()) 4228 return c; // don't try to catch an out of memory exception thrown by the collector4219 return result; // don't try to catch an out of memory exception thrown by the collector 4229 4220 4230 if (catchBlock && c.complType() == Throw) {4231 JSObject *obj = new JSObject;4232 obj->put(exec, exceptionIdent, c.value(), DontDelete);4221 if (catchBlock && exec->completionType() == Throw) { 4222 JSObject* obj = new JSObject; 4223 obj->put(exec, exceptionIdent, result, DontDelete); 4233 4224 exec->pushScope(obj); 4234 c= catchBlock->execute(exec);4225 result = catchBlock->execute(exec); 4235 4226 exec->popScope(); 4236 4227 } 4237 4228 4238 4229 if (finallyBlock) { 4239 Completion c2 = finallyBlock->execute(exec); 4240 if (c2.complType() != Normal) 4241 c = c2; 4230 ComplType savedCompletionType = exec->completionType(); 4231 JSValue* finallyResult = finallyBlock->execute(exec); 4232 if (exec->completionType() != Normal) 4233 result = finallyResult; 4234 else 4235 exec->setCompletionType(savedCompletionType); 4242 4236 } 4243 4237 4244 return c;4238 return result; 4245 4239 } 4246 4240 … … 4497 4491 } 4498 4492 4499 CompletionProgramNode::execute(ExecState* exec)4493 JSValue* ProgramNode::execute(ExecState* exec) 4500 4494 { 4501 4495 processDeclarations(exec); … … 4503 4497 } 4504 4498 4505 CompletionEvalNode::execute(ExecState* exec)4499 JSValue* EvalNode::execute(ExecState* exec) 4506 4500 { 4507 4501 processDeclarations(exec); … … 4509 4503 } 4510 4504 4511 CompletionFunctionBodyNode::execute(ExecState* exec)4505 JSValue* FunctionBodyNode::execute(ExecState* exec) 4512 4506 { 4513 4507 processDeclarations(exec); … … 4516 4510 if (!dbg->callEvent(exec, sourceId(), lineNo(), exec->function(), *exec->arguments())) { 4517 4511 dbg->imp()->abort(); 4518 return Completion(Interrupted, jsUndefined());4512 return exec->setInterruptedCompletion(); 4519 4513 } 4520 4514 } 4521 4515 4522 Completion completion= ScopeNode::execute(exec);4516 JSValue* result = ScopeNode::execute(exec); 4523 4517 4524 4518 if (Debugger* dbg = exec->dynamicGlobalObject()->debugger()) { 4525 if (completion.complType() == Throw) 4526 exec->setException(completion.value()); 4527 4519 if (exec->completionType() == Throw) 4520 exec->setException(result); 4528 4521 if (!dbg->returnEvent(exec, sourceId(), lineNo(), exec->function())) { 4529 4522 dbg->imp()->abort(); 4530 return Completion(Interrupted, jsUndefined());4523 return exec->setInterruptedCompletion(); 4531 4524 } 4532 4525 } 4533 4526 4534 4527 4535 return completion;4528 return result; 4536 4529 } 4537 4530 … … 4556 4549 } 4557 4550 4558 Completion FuncDeclNode::execute(ExecState *)4559 { 4560 return Completion(Normal);4551 JSValue* FuncDeclNode::execute(ExecState* exec) 4552 { 4553 return exec->setNormalCompletion(); 4561 4554 } 4562 4555 -
trunk/JavaScriptCore/kjs/nodes.h
r28899 r28907 145 145 protected: 146 146 Node(JSType) KJS_FAST_CALL; // used by ExpressionNode 147 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg) KJS_FAST_CALL; 148 Completion createErrorCompletion(ExecState *, ErrorType, const char *msg, const Identifier &) KJS_FAST_CALL; 149 147 148 // for use in execute() 149 JSValue* setErrorCompletion(ExecState*, ErrorType, const char* msg) KJS_FAST_CALL; 150 JSValue* setErrorCompletion(ExecState*, ErrorType, const char* msg, const Identifier&) KJS_FAST_CALL; 151 152 // for use in evaluate() 150 153 JSValue* throwError(ExecState*, ErrorType, const char* msg) KJS_FAST_CALL; 151 154 JSValue* throwError(ExecState*, ErrorType, const char* msg, const char*) KJS_FAST_CALL; … … 161 164 void handleException(ExecState*, JSValue*) KJS_FAST_CALL; 162 165 163 Completion rethrowException(ExecState*) KJS_FAST_CALL; 166 // for use in execute() 167 JSValue* rethrowException(ExecState*) KJS_FAST_CALL; 164 168 165 169 int m_line : 28; … … 201 205 int firstLine() const KJS_FAST_CALL { return lineNo(); } 202 206 int lastLine() const KJS_FAST_CALL { return m_lastLine; } 203 bool hitStatement(ExecState*) KJS_FAST_CALL; 204 virtual Completion execute(ExecState *exec) KJS_FAST_CALL = 0; 207 virtual JSValue* execute(ExecState *exec) KJS_FAST_CALL = 0; 205 208 void pushLabel(const Identifier &id) KJS_FAST_CALL { ls.push(id); } 206 209 virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; } 207 210 protected: 211 bool hitStatement(ExecState*) KJS_FAST_CALL; 208 212 LabelStack ls; 209 213 private: … … 1725 1729 VarStatementNode(VarDeclNode* l) KJS_FAST_CALL : next(l) { } 1726 1730 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1727 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1731 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1728 1732 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1729 1733 private: … … 1744 1748 } 1745 1749 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL { ASSERT_NOT_REACHED(); } 1746 virtual Completion execute(ExecState*) KJS_FAST_CALL { ASSERT_NOT_REACHED(); return Completion(); }1750 virtual JSValue* execute(ExecState*) KJS_FAST_CALL { ASSERT_NOT_REACHED(); return 0; } 1747 1751 virtual void streamTo(SourceStream&) const KJS_FAST_CALL { ASSERT_NOT_REACHED(); } 1748 1752 virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; } … … 1755 1759 BlockNode(SourceElements* children) KJS_FAST_CALL; 1756 1760 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1757 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1761 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1758 1762 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1759 1763 protected: … … 1764 1768 public: 1765 1769 EmptyStatementNode() KJS_FAST_CALL { } // debug 1766 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1770 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1767 1771 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1768 1772 }; … … 1772 1776 ExprStatementNode(ExpressionNode* e) KJS_FAST_CALL : expr(e) { } 1773 1777 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1774 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1778 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1775 1779 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1776 1780 private: … … 1783 1787 : expr(e), statement1(s1), statement2(s2) { } 1784 1788 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1785 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1789 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1786 1790 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1787 1791 private: … … 1795 1799 DoWhileNode(StatementNode *s, ExpressionNode* e) KJS_FAST_CALL : statement(s), expr(e) { } 1796 1800 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1797 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1801 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1798 1802 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1799 1803 private: … … 1806 1810 WhileNode(ExpressionNode* e, StatementNode *s) KJS_FAST_CALL : expr(e), statement(s) { } 1807 1811 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1808 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1812 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1809 1813 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1810 1814 private: … … 1825 1829 1826 1830 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1827 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1831 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1828 1832 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1829 1833 private: … … 1839 1843 ForInNode(const Identifier &i, AssignExprNode *in, ExpressionNode* e, StatementNode *s) KJS_FAST_CALL; 1840 1844 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1841 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1845 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1842 1846 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1843 1847 VarDeclNode* getVarDecl() { return varDecl.get(); } … … 1855 1859 ContinueNode() KJS_FAST_CALL { } 1856 1860 ContinueNode(const Identifier &i) KJS_FAST_CALL : ident(i) { } 1857 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1861 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1858 1862 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1859 1863 private: … … 1865 1869 BreakNode() KJS_FAST_CALL { } 1866 1870 BreakNode(const Identifier &i) KJS_FAST_CALL : ident(i) { } 1867 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1871 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1868 1872 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1869 1873 private: … … 1875 1879 ReturnNode(ExpressionNode* v) KJS_FAST_CALL : value(v) {} 1876 1880 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1877 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1881 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1878 1882 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1879 1883 private: … … 1885 1889 WithNode(ExpressionNode* e, StatementNode* s) KJS_FAST_CALL : expr(e), statement(s) { } 1886 1890 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1887 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1891 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1888 1892 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1889 1893 private: … … 1896 1900 LabelNode(const Identifier &l, StatementNode *s) KJS_FAST_CALL : label(l), statement(s) { } 1897 1901 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1898 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1902 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1899 1903 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1900 1904 private: … … 1907 1911 ThrowNode(ExpressionNode* e) KJS_FAST_CALL : expr(e) {} 1908 1912 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1909 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1913 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1910 1914 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1911 1915 private: … … 1918 1922 : tryBlock(b), exceptionIdent(e), catchBlock(c), finallyBlock(f) { } 1919 1923 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 1920 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1924 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1921 1925 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 1922 1926 private: … … 1965 1969 public: 1966 1970 ProgramNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL; 1967 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1971 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1968 1972 1969 1973 private: … … 1978 1982 public: 1979 1983 EvalNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL; 1980 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1984 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1981 1985 1982 1986 private: … … 1988 1992 FunctionBodyNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL; 1989 1993 1990 virtual Completionexecute(ExecState*) KJS_FAST_CALL;1994 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 1991 1995 1992 1996 SymbolTable& symbolTable() KJS_FAST_CALL { return m_symbolTable; } … … 2026 2030 FuncDeclNode(const Identifier& i, ParameterNode* p, FunctionBodyNode* b) KJS_FAST_CALL 2027 2031 : ident(i), param(p), body(b) { addParams(); } 2028 virtual Completionexecute(ExecState*) KJS_FAST_CALL;2032 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 2029 2033 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 2030 2034 ALWAYS_INLINE FunctionImp* makeFunction(ExecState*) KJS_FAST_CALL; … … 2046 2050 2047 2051 JSValue* evaluate(ExecState*) KJS_FAST_CALL; 2048 Completion evalStatements(ExecState*) KJS_FAST_CALL;2052 JSValue* executeStatements(ExecState*) KJS_FAST_CALL; 2049 2053 2050 2054 private: … … 2074 2078 CaseBlockNode(ClauseListNode* l1, CaseClauseNode* d, ClauseListNode* l2) KJS_FAST_CALL; 2075 2079 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 2076 Completion evalBlock(ExecState *exec, JSValue *input) KJS_FAST_CALL;2080 JSValue* executeBlock(ExecState*, JSValue *input) KJS_FAST_CALL; 2077 2081 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 2078 2082 virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; } … … 2087 2091 SwitchNode(ExpressionNode* e, CaseBlockNode *b) KJS_FAST_CALL : expr(e), block(b) { } 2088 2092 virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL; 2089 virtual Completionexecute(ExecState*) KJS_FAST_CALL;2093 virtual JSValue* execute(ExecState*) KJS_FAST_CALL; 2090 2094 virtual void streamTo(SourceStream&) const KJS_FAST_CALL; 2091 2095 private: -
trunk/JavaScriptCore/kjs/number_object.h
r28899 r28907 89 89 enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue }; 90 90 91 Completion execute(const List &);92 91 JSObject *construct(const List &); 93 92 };
Note: See TracChangeset
for help on using the changeset viewer.