Changeset 28899 in webkit


Ignore:
Timestamp:
Dec 20, 2007 12:33:42 PM (16 years ago)
Author:
Darin Adler
Message:
  • roll out that last change -- it was causing test failures; I'll check it back in after fixing them
Location:
trunk/JavaScriptCore
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSContextRef.cpp

    r28887 r28899  
    3232#include "JSClassRef.h"
    3333#include "JSGlobalObject.h"
     34#include "completion.h"
    3435#include "object.h"
    3536#include <wtf/Platform.h>
  • trunk/JavaScriptCore/ChangeLog

    r28887 r28899  
     12007-12-20  Darin Adler  <darin@apple.com>
     2
     3        - roll out that last change -- it was causing test failures;
     4          I'll check it back in after fixing them
     5
    162007-12-20  Darin Adler  <darin@apple.com>
    27
  • trunk/JavaScriptCore/bindings/runtime_method.cpp

    r28887 r28899  
    9393    return aValue;
    9494}
     95
     96Completion RuntimeMethod::execute(ExecState*)
     97{
     98    return Completion(Normal, jsUndefined());
     99}
  • trunk/JavaScriptCore/bindings/runtime_method.h

    r28887 r28899  
    3333namespace KJS {
    3434
    35 class RuntimeMethod : public InternalFunctionImp {
     35
     36class RuntimeMethod : public InternalFunctionImp
     37{
    3638public:
    3739    RuntimeMethod(ExecState *exec, const Identifier &n, Bindings::MethodList &methodList);
     
    4042
    4143    virtual JSValue *callAsFunction(ExecState *exec, JSObject *thisObj, const List &args);
     44
     45    virtual Completion execute(ExecState *exec);
    4246
    4347private:
  • trunk/JavaScriptCore/kjs/ExecState.h

    r28887 r28899  
    109109
    110110        LocalStorage& localStorage() { return *m_localStorage; }
    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 
     111   
    174112    public:
    175113        ExecState(JSGlobalObject* glob, JSObject* thisV,
     
    204142        int m_switchDepth;
    205143        CodeType m_codeType;
    206 
    207         ComplType m_completionType;
    208         const Identifier* m_breakOrContinueTarget;
    209144    };
    210145
  • trunk/JavaScriptCore/kjs/array_instance.cpp

    r28782 r28899  
    181181bool ArrayInstance::getOwnPropertySlot(ExecState* exec, unsigned i, PropertySlot& slot)
    182182{
    183     return inlineGetOwnPropertySlot(exec, i, slot);
     183    return JSObject::getOwnPropertySlot(exec, i, slot);
    184184}
    185185
  • trunk/JavaScriptCore/kjs/completion.h

    r28887 r28899  
    2727namespace KJS {
    2828
     29  class Identifier;
    2930  class JSValue;
    3031
     
    4445  public:
    4546    Completion(ComplType type = Normal, JSValue* value = 0)
    46         : m_type(type), m_value(value) { }
     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) { }
    4750
    4851    ComplType complType() const { return m_type; }
    4952    JSValue* value() const { return m_value; }
    5053    void setValue(JSValue* v) { m_value = v; }
     54    const Identifier& target() const { return *m_target; }
    5155    bool isValueCompletion() const { return !!m_value; }
    5256
     
    5458    ComplType m_type;
    5559    JSValue* m_value;
     60    const Identifier* m_target;
    5661  };
    5762
  • trunk/JavaScriptCore/kjs/date_object.h

    r28887 r28899  
    133133        virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
    134134
     135        Completion execute(const List &);
    135136        JSObject *construct(const List &);
    136137    };
  • trunk/JavaScriptCore/kjs/function.cpp

    r28887 r28899  
    7171JSValue* FunctionImp::callAsFunction(ExecState* exec, JSObject* thisObj, const List& args)
    7272{
    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;
     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
    8191    return jsUndefined();
    8292}
     
    203213  else
    204214    return obj;
     215}
     216
     217Completion 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 ?
    205224}
    206225
     
    700719        JSObject* thisVal = static_cast<JSObject*>(exec->thisValue());
    701720        ExecState newExec(globalObject, thisVal, evalNode.get(), EvalCode, exec, globalObject->currentExec());
     721        if (exec->hadException())
     722            newExec.setException(exec->exception());
    702723         
    703724        if (switchGlobal) {
     
    705726            newExec.setVariableObject(static_cast<JSGlobalObject*>(thisObj));
    706727        }
    707         JSValue* value = evalNode->execute(&newExec);
     728       
     729        Completion c = evalNode->execute(&newExec);
     730         
    708731        if (switchGlobal)
    709732            newExec.popScope();
    710733
    711         if (exec->completionType() == Throw) {
    712             exec->setException(value);
    713             return value;
    714         }
    715         return value ? value : jsUndefined();
     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();
    716743      }
     744      break;
    717745    }
    718746  case ParseInt:
  • trunk/JavaScriptCore/kjs/function.h

    r28887 r28899  
    8383   
    8484    virtual JSValue* callAsFunction(ExecState*, JSObject* thisObj, const List& args);
     85    Completion execute(ExecState*);
    8586
    8687    // Note: unlike body->paramName, this returns Identifier::null for parameters
  • trunk/JavaScriptCore/kjs/interpreter.cpp

    r28887 r28899  
    121121        // execute the code
    122122        ExecState newExec(globalObject, thisObj, progNode.get());
    123         JSValue* value = progNode->execute(&newExec);
    124         res = Completion(newExec.completionType(), value);
     123        res = progNode->execute(&newExec);
    125124    }
    126125   
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r28887 r28899  
    4747#define KJS_BREAKPOINT \
    4848  if (Debugger::debuggersPresent > 0 && !hitStatement(exec)) \
    49     return 0;
     49    return Completion(Normal);
    5050
    5151#define KJS_CHECKEXCEPTION \
     
    272272}
    273273
    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)
     274Completion 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
     279Completion Node::createErrorCompletion(ExecState *exec, ErrorType e, const char *msg, const Identifier &ident)
    280280{
    281281    UString message = msg;
    282282    substitute(message, ident.ustring());
    283     return exec->setThrowCompletion(Error::create(exec, e, message, lineNo(), currentSourceId(exec), currentSourceURL(exec)));
     283    return Completion(Throw, Error::create(exec, e, message, lineNo(), currentSourceId(exec), currentSourceURL(exec)));
    284284}
    285285
     
    365365}
    366366
    367 JSValue* Node::rethrowException(ExecState* exec)
     367Completion Node::rethrowException(ExecState* exec)
    368368{
    369369    JSValue* exception = exec->exception();
    370370    exec->clearException();
    371371    handleException(exec, exception);
    372     return exec->setThrowCompletion(exception);
     372    return Completion(Throw, exception);
    373373}
    374374
     
    387387}
    388388
    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"?
     389// return true if the debugger wants us to stop at this point
    391390bool StatementNode::hitStatement(ExecState* exec)
    392391{
    393     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;
     392  Debugger *dbg = exec->dynamicGlobalObject()->debugger();
     393  if (dbg)
     394    return dbg->atStatement(exec, currentSourceId(exec), firstLine(), lastLine());
     395  else
     396    return true; // continue
    398397}
    399398
     
    35503549
    35513550// ECMA 12.2
    3552 JSValue* VarStatementNode::execute(ExecState* exec)
    3553 {
    3554     KJS_BREAKPOINT
     3551Completion VarStatementNode::execute(ExecState *exec)
     3552{
     3553    KJS_BREAKPOINT;
    35553554
    35563555    next->evaluate(exec);
    35573556    KJS_CHECKEXCEPTION
    35583557
    3559     return exec->setNormalCompletion();
     3558    return Completion(Normal);
    35603559}
    35613560
     
    35893588}
    35903589
    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 
     3590static 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   
    36053608// ------------------------------ BlockNode ------------------------------------
    36063609
     
    36173620
    36183621// ECMA 12.1
    3619 JSValue* BlockNode::execute(ExecState* exec)
     3622Completion BlockNode::execute(ExecState *exec)
    36203623{
    36213624    return statementListExecute(*m_children, exec);
     
    36253628
    36263629// ECMA 12.3
    3627 JSValue* EmptyStatementNode::execute(ExecState* exec)
    3628 {
    3629     return exec->setNormalCompletion();
     3630Completion EmptyStatementNode::execute(ExecState *)
     3631{
     3632  return Completion(Normal);
    36303633}
    36313634
     
    36393642
    36403643// ECMA 12.4
    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);
     3644Completion ExprStatementNode::execute(ExecState *exec)
     3645{
     3646  KJS_BREAKPOINT;
     3647
     3648  JSValue *v = expr->evaluate(exec);
     3649  KJS_CHECKEXCEPTION
     3650
     3651  return Completion(Normal, v);
    36493652}
    36503653
     
    36623665
    36633666// ECMA 12.5
    3664 JSValue* IfNode::execute(ExecState* exec)
    3665 {
    3666     KJS_BREAKPOINT
     3667Completion IfNode::execute(ExecState* exec)
     3668{
     3669    KJS_BREAKPOINT;
    36673670
    36683671    bool b = expr->evaluateToBoolean(exec);
     
    36753678    // no else
    36763679    if (!statement2)
    3677         return exec->setNormalCompletion();
     3680        return Completion(Normal);
    36783681
    36793682    // else
     
    36903693
    36913694// ECMA 12.6.1
    3692 JSValue* DoWhileNode::execute(ExecState* exec)
    3693 {
    3694     KJS_BREAKPOINT
     3695Completion DoWhileNode::execute(ExecState *exec)
     3696{
     3697    KJS_BREAKPOINT;
    36953698
    36963699    JSValue* value = 0;
     
    36983701    while (1) {
    36993702        exec->pushIteration();
    3700         JSValue* statementValue = statement->execute(exec);
     3703        Completion c = statement->execute(exec);
    37013704        exec->popIteration();
    37023705
    37033706        if (exec->dynamicGlobalObject()->timedOut())
    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;
     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;
    37153717        }
    37163718
    3717 continueDoWhileLoop:
    37183719        bool b = expr->evaluateToBoolean(exec);
    37193720        KJS_CHECKEXCEPTION
    37203721        if (!b)
    3721             break;
    3722     }
    3723 
    3724     return exec->setNormalCompletion(value);
     3722            return Completion(Normal, value);
     3723    }
     3724
     3725    return Completion(); // work around gcc 4.0 bug
    37253726}
    37263727
     
    37343735
    37353736// ECMA 12.6.2
    3736 JSValue* WhileNode::execute(ExecState* exec)
    3737 {
    3738     KJS_BREAKPOINT
     3737Completion WhileNode::execute(ExecState *exec)
     3738{
     3739    KJS_BREAKPOINT;
    37393740
    37403741    JSValue* value = 0;
     
    37443745        KJS_CHECKEXCEPTION
    37453746        if (!b)
    3746             break;
     3747            return Completion(Normal, value);
    37473748
    37483749        exec->pushIteration();
    3749         JSValue* statementValue = statement->execute(exec);
     3750        Completion c = statement->execute(exec);
    37503751        exec->popIteration();
    37513752
    37523753        if (exec->dynamicGlobalObject()->timedOut())
    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);
     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
    37683768}
    37693769
     
    37823782
    37833783// ECMA 12.6.3
    3784 JSValue* ForNode::execute(ExecState *exec)
    3785 {
    3786     JSValue* value = 0;
     3784Completion ForNode::execute(ExecState *exec)
     3785{
     3786    JSValue* cval = 0;
    37873787
    37883788    if (expr1) {
     
    37963796            KJS_CHECKEXCEPTION
    37973797            if (!b)
    3798                 break;
     3798                return Completion(Normal, cval);
    37993799        }
    38003800
    38013801        exec->pushIteration();
    3802         JSValue* statementValue = statement->execute(exec);
     3802        Completion c = statement->execute(exec);
    38033803        exec->popIteration();
    3804         if (statementValue)
    3805             value = statementValue;
     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;
     3811        }
    38063812
    38073813        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;
    3816         }
    3817 
    3818 continueForLoop:
     3814            return Completion(Interrupted);
     3815
    38193816        if (expr3) {
    38203817            expr3->evaluate(exec);
     
    38233820    }
    38243821 
    3825     return exec->setNormalCompletion(value);
     3822    return Completion(); // work around gcc 4.0 bug
    38263823}
    38273824
     
    38513848
    38523849// ECMA 12.6.4
    3853 JSValue* ForInNode::execute(ExecState* exec)
    3854 {
    3855   JSValue* value = 0;
     3850Completion ForInNode::execute(ExecState *exec)
     3851{
     3852  JSValue *e;
     3853  JSValue *retval = 0;
     3854  JSObject *v;
     3855  Completion c;
     3856  PropertyNameArray propertyNames;
    38563857
    38573858  if (varDecl) {
     
    38603861  }
    38613862
    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.
     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.
    38663869  if (e->isUndefinedOrNull())
    3867     return exec->setNormalCompletion();
     3870    return Completion(Normal);
    38683871
    38693872  KJS_CHECKEXCEPTION
    3870   JSObject* v = e->toObject(exec);
    3871   PropertyNameArray propertyNames;
     3873  v = e->toObject(exec);
    38723874  v->getPropertyNames(exec, propertyNames);
    38733875 
    38743876  PropertyNameArray::const_iterator end = propertyNames.end();
    38753877  for (PropertyNameArray::const_iterator it = propertyNames.begin(); it != end; ++it) {
    3876       const Identifier& name = *it;
     3878      const Identifier &name = *it;
    38773879      if (!v->hasProperty(exec, name))
    38783880          continue;
     
    39273929
    39283930    exec->pushIteration();
    3929     JSValue* statementValue = statement->execute(exec);
     3931    c = statement->execute(exec);
    39303932    exec->popIteration();
    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;
     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      }
    39403942    }
    39413943  }
    39423944
    3943   return exec->setNormalCompletion(value);
     3945  return Completion(Normal, retval);
    39443946}
    39453947
     
    39473949
    39483950// ECMA 12.7
    3949 JSValue* ContinueNode::execute(ExecState* exec)
    3950 {
    3951   KJS_BREAKPOINT
     3951Completion ContinueNode::execute(ExecState *exec)
     3952{
     3953  KJS_BREAKPOINT;
    39523954
    39533955  if (ident.isEmpty() && !exec->inIteration())
    3954     return setErrorCompletion(exec, SyntaxError, "Invalid continue statement.");
     3956    return createErrorCompletion(exec, SyntaxError, "Invalid continue statement.");
    39553957  if (!ident.isEmpty() && !exec->seenLabels()->contains(ident))
    3956     return setErrorCompletion(exec, SyntaxError, "Label %s not found.", ident);
    3957   return exec->setContinueCompletion(&ident);
     3958    return createErrorCompletion(exec, SyntaxError, "Label %s not found.", ident);
     3959  return Completion(Continue, &ident);
    39583960}
    39593961
     
    39613963
    39623964// ECMA 12.8
    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.");
     3965Completion 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.");
    39693972  if (!ident.isEmpty() && !exec->seenLabels()->contains(ident))
    3970     return setErrorCompletion(exec, SyntaxError, "Label %s not found.");
    3971   return exec->setBreakCompletion(&ident);
     3973    return createErrorCompletion(exec, SyntaxError, "Label %s not found.");
     3974  return Completion(Break, &ident);
    39723975}
    39733976
     
    39813984
    39823985// ECMA 12.9
    3983 JSValue* ReturnNode::execute(ExecState* exec)
    3984 {
    3985   KJS_BREAKPOINT
     3986Completion ReturnNode::execute(ExecState *exec)
     3987{
     3988  KJS_BREAKPOINT;
    39863989
    39873990  CodeType codeType = exec->codeType();
    39883991  if (codeType != FunctionCode)
    3989     return setErrorCompletion(exec, SyntaxError, "Invalid return statement.");
     3992    return createErrorCompletion(exec, SyntaxError, "Invalid return statement.");
    39903993
    39913994  if (!value)
    3992     return exec->setReturnValueCompletion(jsUndefined());
    3993 
    3994   JSValue* v = value->evaluate(exec);
     3995    return Completion(ReturnValue, jsUndefined());
     3996
     3997  JSValue *v = value->evaluate(exec);
    39953998  KJS_CHECKEXCEPTION
    39963999
    3997   return exec->setReturnValueCompletion(v);
     4000  return Completion(ReturnValue, v);
    39984001}
    39994002
     
    40074010
    40084011// ECMA 12.10
    4009 JSValue* WithNode::execute(ExecState *exec)
    4010 {
    4011   KJS_BREAKPOINT
     4012Completion WithNode::execute(ExecState *exec)
     4013{
     4014  KJS_BREAKPOINT;
    40124015
    40134016  JSValue *v = expr->evaluate(exec);
     
    40164019  KJS_CHECKEXCEPTION
    40174020  exec->pushScope(o);
    4018   JSValue* value = statement->execute(exec);
     4021  Completion res = statement->execute(exec);
    40194022  exec->popScope();
    40204023
    4021   return value;
     4024  return res;
    40224025}
    40234026   
     
    40424045
    40434046// ECMA 12.11
    4044 JSValue* CaseClauseNode::executeStatements(ExecState* exec)
     4047Completion CaseClauseNode::evalStatements(ExecState *exec)
    40454048{
    40464049  if (m_children)
    40474050    return statementListExecute(*m_children, exec);
    4048   return exec->setNormalCompletion();
     4051  else
     4052    return Completion(Normal, jsUndefined());
    40494053}
    40504054
     
    40784082
    40794083// ECMA 12.11
    4080 JSValue* CaseBlockNode::executeBlock(ExecState* exec, JSValue* input)
    4081 {
    4082   ClauseListNode* a = list1.get();
     4084Completion 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
    40834092    while (a) {
    4084       CaseClauseNode* clause = a->getClause();
     4093      clause = a->getClause();
    40854094      a = a->getNext();
    4086       JSValue* v = clause->evaluate(exec);
     4095      v = clause->evaluate(exec);
    40874096      KJS_CHECKEXCEPTION
    40884097      if (strictEqual(exec, input, v)) {
    4089         JSValue* res = clause->executeStatements(exec);
    4090         if (exec->completionType() != Normal)
     4098        res = clause->evalStatements(exec);
     4099        if (res.complType() != Normal)
    40914100          return res;
    4092         for (; a; a = a->getNext()) {
    4093           JSValue* res = a->getClause()->executeStatements(exec);
    4094           if (exec->completionType() != Normal)
     4101        while (a) {
     4102          res = a->getClause()->evalStatements(exec);
     4103          if (res.complType() != Normal)
    40954104            return res;
     4105          a = a->getNext();
    40964106        }
    40974107        break;
     
    40994109    }
    41004110
    4101   ClauseListNode* b = list2.get();
    41024111  while (b) {
    4103     CaseClauseNode* clause = b->getClause();
     4112    clause = b->getClause();
    41044113    b = b->getNext();
    4105     JSValue* v = clause->evaluate(exec);
     4114    v = clause->evaluate(exec);
    41064115    KJS_CHECKEXCEPTION
    41074116    if (strictEqual(exec, input, v)) {
    4108       JSValue* res = clause->executeStatements(exec);
    4109       if (exec->completionType() != Normal)
     4117      res = clause->evalStatements(exec);
     4118      if (res.complType() != Normal)
    41104119        return res;
    41114120      goto step18;
     
    41154124  // default clause
    41164125  if (def) {
    4117     JSValue* res = def->executeStatements(exec);
    4118     if (exec->completionType() != Normal)
     4126    res = def->evalStatements(exec);
     4127    if (res.complType() != Normal)
    41194128      return res;
    41204129  }
     
    41224131 step18:
    41234132  while (b) {
    4124     CaseClauseNode* clause = b->getClause();
    4125     JSValue* res = clause->executeStatements(exec);
    4126     if (exec->completionType() != Normal)
     4133    clause = b->getClause();
     4134    res = clause->evalStatements(exec);
     4135    if (res.complType() != Normal)
    41274136      return res;
    41284137    b = b->getNext();
     
    41324141  KJS_CHECKEXCEPTION
    41334142
    4134   return exec->setNormalCompletion();
     4143  return Completion(Normal);
    41354144}
    41364145
     
    41444153
    41454154// ECMA 12.11
    4146 JSValue* SwitchNode::execute(ExecState* exec)
    4147 {
    4148   KJS_BREAKPOINT
     4155Completion SwitchNode::execute(ExecState *exec)
     4156{
     4157  KJS_BREAKPOINT;
    41494158
    41504159  JSValue *v = expr->evaluate(exec);
     
    41524161
    41534162  exec->pushSwitch();
    4154   JSValue* result = block->executeBlock(exec, v);
     4163  Completion res = block->evalBlock(exec,v);
    41554164  exec->popSwitch();
    41564165
    4157   if (exec->completionType() == Break && ls.contains(exec->breakOrContinueTarget()))
    4158     exec->setCompletionType(Normal);
    4159   return result;
     4166  if ((res.complType() == Break) && ls.contains(res.target()))
     4167    return Completion(Normal, res.value());
     4168  return res;
    41604169}
    41614170
     
    41684177
    41694178// ECMA 12.12
    4170 JSValue* LabelNode::execute(ExecState *exec)
     4179Completion LabelNode::execute(ExecState *exec)
    41714180{
    41724181  if (!exec->seenLabels()->push(label))
    4173     return setErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label);
    4174   JSValue* result = statement->execute(exec);
     4182    return createErrorCompletion(exec, SyntaxError, "Duplicated label %s found.", label);
     4183  Completion e = statement->execute(exec);
    41754184  exec->seenLabels()->pop();
    41764185
    4177   if (exec->completionType() == Break && exec->breakOrContinueTarget() == label)
    4178     exec->setCompletionType(Normal);
    4179   return result;
     4186  if ((e.complType() == Break) && (e.target() == label))
     4187    return Completion(Normal, e.value());
     4188  return e;
    41804189}
    41814190
     
    41884197
    41894198// ECMA 12.13
    4190 JSValue* ThrowNode::execute(ExecState* exec)
    4191 {
    4192   KJS_BREAKPOINT
     4199Completion ThrowNode::execute(ExecState *exec)
     4200{
     4201  KJS_BREAKPOINT;
    41934202
    41944203  JSValue *v = expr->evaluate(exec);
     
    41964205
    41974206  handleException(exec, v);
    4198   return exec->setThrowCompletion(v);
     4207  return Completion(Throw, v);
    41994208}
    42004209
     
    42104219
    42114220// ECMA 12.14
    4212 JSValue* TryNode::execute(ExecState *exec)
    4213 {
    4214   KJS_BREAKPOINT
    4215 
    4216   JSValue* result = tryBlock->execute(exec);
     4221Completion TryNode::execute(ExecState *exec)
     4222{
     4223  KJS_BREAKPOINT;
     4224
     4225  Completion c = tryBlock->execute(exec);
    42174226
    42184227  if (Collector::isOutOfMemory())
    4219       return result; // don't try to catch an out of memory exception thrown by the collector
     4228      return c; // don't try to catch an out of memory exception thrown by the collector
    42204229 
    4221   if (catchBlock && exec->completionType() == Throw) {
    4222     JSObject* obj = new JSObject;
    4223     obj->put(exec, exceptionIdent, result, DontDelete);
     4230  if (catchBlock && c.complType() == Throw) {
     4231    JSObject *obj = new JSObject;
     4232    obj->put(exec, exceptionIdent, c.value(), DontDelete);
    42244233    exec->pushScope(obj);
    4225     result = catchBlock->execute(exec);
     4234    c = catchBlock->execute(exec);
    42264235    exec->popScope();
    42274236  }
    42284237
    42294238  if (finallyBlock) {
    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);
     4239    Completion c2 = finallyBlock->execute(exec);
     4240    if (c2.complType() != Normal)
     4241      c = c2;
    42364242  }
    42374243
    4238   return result;
     4244  return c;
    42394245}
    42404246
     
    44914497}
    44924498
    4493 JSValue* ProgramNode::execute(ExecState* exec)
     4499Completion ProgramNode::execute(ExecState* exec)
    44944500{
    44954501    processDeclarations(exec);
     
    44974503}
    44984504
    4499 JSValue* EvalNode::execute(ExecState* exec)
     4505Completion EvalNode::execute(ExecState* exec)
    45004506{
    45014507    processDeclarations(exec);
     
    45034509}
    45044510
    4505 JSValue* FunctionBodyNode::execute(ExecState* exec)
     4511Completion FunctionBodyNode::execute(ExecState* exec)
    45064512{
    45074513    processDeclarations(exec);
     
    45104516        if (!dbg->callEvent(exec, sourceId(), lineNo(), exec->function(), *exec->arguments())) {
    45114517            dbg->imp()->abort();
    4512             return exec->setInterruptedCompletion();
     4518            return Completion(Interrupted, jsUndefined());
    45134519        }
    45144520    }   
    45154521   
    4516     JSValue* result = ScopeNode::execute(exec);
     4522    Completion completion = ScopeNode::execute(exec);
    45174523   
    45184524    if (Debugger* dbg = exec->dynamicGlobalObject()->debugger()) {
    4519         if (exec->completionType() == Throw)
    4520             exec->setException(result);
     4525        if (completion.complType() == Throw)
     4526            exec->setException(completion.value());
     4527
    45214528        if (!dbg->returnEvent(exec, sourceId(), lineNo(), exec->function())) {
    45224529            dbg->imp()->abort();
    4523             return exec->setInterruptedCompletion();
     4530            return Completion(Interrupted, jsUndefined());
    45244531        }
    45254532    }
    45264533
    45274534   
    4528     return result;
     4535    return completion;
    45294536}
    45304537
     
    45494556}
    45504557
    4551 JSValue* FuncDeclNode::execute(ExecState* exec)
    4552 {
    4553     return exec->setNormalCompletion();
     4558Completion FuncDeclNode::execute(ExecState *)
     4559{
     4560    return Completion(Normal);
    45544561}
    45554562
  • trunk/JavaScriptCore/kjs/nodes.h

    r28887 r28899  
    145145  protected:
    146146    Node(JSType) KJS_FAST_CALL; // used by ExpressionNode
    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()
     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
    153150    JSValue* throwError(ExecState*, ErrorType, const char* msg) KJS_FAST_CALL;
    154151    JSValue* throwError(ExecState*, ErrorType, const char* msg, const char*) KJS_FAST_CALL;
     
    164161    void handleException(ExecState*, JSValue*) KJS_FAST_CALL;
    165162
    166     // for use in execute()
    167     JSValue* rethrowException(ExecState*) KJS_FAST_CALL;
     163    Completion rethrowException(ExecState*) KJS_FAST_CALL;
    168164
    169165    int m_line : 28;
     
    205201    int firstLine() const KJS_FAST_CALL { return lineNo(); }
    206202    int lastLine() const KJS_FAST_CALL { return m_lastLine; }
    207     virtual JSValue* execute(ExecState *exec) KJS_FAST_CALL = 0;
     203    bool hitStatement(ExecState*) KJS_FAST_CALL;
     204    virtual Completion execute(ExecState *exec) KJS_FAST_CALL = 0;
    208205    void pushLabel(const Identifier &id) KJS_FAST_CALL { ls.push(id); }
    209206    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
    210207  protected:
    211     bool hitStatement(ExecState*) KJS_FAST_CALL;
    212208    LabelStack ls;
    213209  private:
     
    17291725    VarStatementNode(VarDeclNode* l) KJS_FAST_CALL : next(l) { }
    17301726    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1731     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1727    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    17321728    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17331729  private:
     
    17481744    }
    17491745    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL { ASSERT_NOT_REACHED(); }
    1750     virtual JSValue* execute(ExecState*) KJS_FAST_CALL  { ASSERT_NOT_REACHED(); return 0; }
     1746    virtual Completion execute(ExecState*) KJS_FAST_CALL  { ASSERT_NOT_REACHED(); return Completion(); }
    17511747    virtual void streamTo(SourceStream&) const KJS_FAST_CALL  { ASSERT_NOT_REACHED(); }
    17521748    virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
     
    17591755    BlockNode(SourceElements* children) KJS_FAST_CALL;
    17601756    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1761     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1757    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    17621758    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17631759  protected:
     
    17681764  public:
    17691765    EmptyStatementNode() KJS_FAST_CALL { } // debug
    1770     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1766    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    17711767    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17721768  };
     
    17761772    ExprStatementNode(ExpressionNode* e) KJS_FAST_CALL : expr(e) { }
    17771773    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1778     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1774    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    17791775    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17801776  private:
     
    17871783      : expr(e), statement1(s1), statement2(s2) { }
    17881784    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1789     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1785    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    17901786    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    17911787  private:
     
    17991795    DoWhileNode(StatementNode *s, ExpressionNode* e) KJS_FAST_CALL : statement(s), expr(e) { }
    18001796    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1801     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1797    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18021798    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18031799  private:
     
    18101806    WhileNode(ExpressionNode* e, StatementNode *s) KJS_FAST_CALL : expr(e), statement(s) { }
    18111807    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1812     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1808    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18131809    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18141810  private:
     
    18291825
    18301826    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1831     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1827    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18321828    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18331829  private:
     
    18431839    ForInNode(const Identifier &i, AssignExprNode *in, ExpressionNode* e, StatementNode *s) KJS_FAST_CALL;
    18441840    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1845     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1841    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18461842    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18471843    VarDeclNode* getVarDecl() { return varDecl.get(); }
     
    18591855    ContinueNode() KJS_FAST_CALL { }
    18601856    ContinueNode(const Identifier &i) KJS_FAST_CALL : ident(i) { }
    1861     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1857    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18621858    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18631859  private:
     
    18691865    BreakNode() KJS_FAST_CALL { }
    18701866    BreakNode(const Identifier &i) KJS_FAST_CALL : ident(i) { }
    1871     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1867    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18721868    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18731869  private:
     
    18791875    ReturnNode(ExpressionNode* v) KJS_FAST_CALL : value(v) {}
    18801876    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1881     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1877    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18821878    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18831879  private:
     
    18891885    WithNode(ExpressionNode* e, StatementNode* s) KJS_FAST_CALL : expr(e), statement(s) { }
    18901886    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1891     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1887    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    18921888    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    18931889  private:
     
    19001896    LabelNode(const Identifier &l, StatementNode *s) KJS_FAST_CALL : label(l), statement(s) { }
    19011897    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1902     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1898    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    19031899    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    19041900  private:
     
    19111907    ThrowNode(ExpressionNode* e) KJS_FAST_CALL : expr(e) {}
    19121908    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1913     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1909    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    19141910    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    19151911  private:
     
    19221918      : tryBlock(b), exceptionIdent(e), catchBlock(c), finallyBlock(f) { }
    19231919    virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    1924     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1920    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    19251921    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    19261922  private:
     
    19691965  public:
    19701966    ProgramNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL;
    1971     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1967    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    19721968   
    19731969  private:
     
    19821978  public:
    19831979    EvalNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL;
    1984     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1980    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    19851981   
    19861982  private:
     
    19921988    FunctionBodyNode(SourceElements*, DeclarationStacks::VarStack*, DeclarationStacks::FunctionStack*) KJS_FAST_CALL;
    19931989
    1994     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     1990    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    19951991
    19961992    SymbolTable& symbolTable() KJS_FAST_CALL { return m_symbolTable; }
     
    20302026    FuncDeclNode(const Identifier& i, ParameterNode* p, FunctionBodyNode* b) KJS_FAST_CALL
    20312027      : ident(i), param(p), body(b) { addParams(); }
    2032     virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     2028    virtual Completion execute(ExecState*) KJS_FAST_CALL;
    20332029    virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    20342030    ALWAYS_INLINE FunctionImp* makeFunction(ExecState*) KJS_FAST_CALL;
     
    20502046
    20512047      JSValue* evaluate(ExecState*) KJS_FAST_CALL;
    2052       JSValue* executeStatements(ExecState*) KJS_FAST_CALL;
     2048      Completion evalStatements(ExecState*) KJS_FAST_CALL;
    20532049
    20542050  private:
     
    20782074      CaseBlockNode(ClauseListNode* l1, CaseClauseNode* d, ClauseListNode* l2) KJS_FAST_CALL;
    20792075      virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    2080       JSValue* executeBlock(ExecState*, JSValue *input) KJS_FAST_CALL;
     2076      Completion evalBlock(ExecState *exec, JSValue *input) KJS_FAST_CALL;
    20812077      virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    20822078      virtual Precedence precedence() const { ASSERT_NOT_REACHED(); return PrecExpression; }
     
    20912087      SwitchNode(ExpressionNode* e, CaseBlockNode *b) KJS_FAST_CALL : expr(e), block(b) { }
    20922088      virtual void optimizeVariableAccess(SymbolTable&, DeclarationStacks::NodeStack&) KJS_FAST_CALL;
    2093       virtual JSValue* execute(ExecState*) KJS_FAST_CALL;
     2089      virtual Completion execute(ExecState*) KJS_FAST_CALL;
    20942090      virtual void streamTo(SourceStream&) const KJS_FAST_CALL;
    20952091  private:
  • trunk/JavaScriptCore/kjs/number_object.h

    r28887 r28899  
    8989    enum { NaNValue, NegInfinity, PosInfinity, MaxValue, MinValue };
    9090
     91    Completion execute(const List &);
    9192    JSObject *construct(const List &);
    9293  };
Note: See TracChangeset for help on using the changeset viewer.