Ignore:
Timestamp:
Oct 26, 2007, 3:36:45 AM (18 years ago)
Author:
mjs
Message:

Windows build fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ExecState.cpp

    r27098 r27100  
    1 // -*- c-basic-offset: 2 -*-
     1// -*- mode: c++; c-basic-offset: 4 -*-
    22/*
    33 *  This file is part of the KDE libraries
    44 *  Copyright (C) 1999-2001 Harri Porten ([email protected])
    55 *  Copyright (C) 2001 Peter Kelly ([email protected])
    6  *  Copyright (C) 2003 Apple Computer, Inc.
     6 *  Copyright (C) 2003, 2007 Apple Inc. All rights reserved.
    77 *
    88 *  This library is free software; you can redistribute it and/or
     
    3434
    3535// ECMA 10.2
    36 Context::Context(JSGlobalObject* glob, Interpreter* interpreter, JSObject* thisV,
    37                  FunctionBodyNode* currentBody, CodeType type, Context* callingCon,
    38                  FunctionImp* func, const List* args)
     36ExecState::ExecState(Interpreter* interpreter, JSGlobalObject* glob, JSObject* thisV,
     37                     FunctionBodyNode* currentBody, CodeType type, ExecState* callingExec,
     38                     FunctionImp* func, const List* args)
    3939    : m_interpreter(interpreter)
    40     , m_savedContext(interpreter->context())
     40    , m_exception(0)
     41    , m_propertyNames(CommonIdentifiers::shared())
     42    , m_savedExecState(interpreter->currentExec())
    4143    , m_currentBody(currentBody)
    4244    , m_function(func)
     
    4648{
    4749    m_codeType = type;
    48     m_callingContext = callingCon;
     50    m_callingExecState = callingExec;
    4951   
    5052    // create and initialize activation object (ECMA 10.1.6)
     
    6062    switch(type) {
    6163    case EvalCode:
    62         if (m_callingContext) {
    63             scope = m_callingContext->scopeChain();
    64             m_variable = m_callingContext->variableObject();
    65             m_thisVal = m_callingContext->thisValue();
     64        if (m_callingExecState) {
     65            scope = m_callingExecState->scopeChain();
     66            m_variable = m_callingExecState->variableObject();
     67            m_thisVal = m_callingExecState->thisValue();
    6668            break;
    6769        } // else same as GlobalCode
     
    7981    }
    8082
    81     m_interpreter->setContext(this);
     83    if (currentBody)
     84        m_interpreter->setCurrentExec(this);
    8285}
    8386
    84 Context::~Context()
     87ExecState::~ExecState()
    8588{
    86     m_interpreter->setContext(m_savedContext);
     89    m_interpreter->setCurrentExec(m_savedExecState);
    8790
    8891    // The arguments list is only needed to potentially create the  arguments object,
     
    9598}
    9699
    97 void Context::mark()
     100void ExecState::mark()
    98101{
    99     for (Context* context = this; context; context = context->m_callingContext)
    100         context->scope.mark();
     102    for (ExecState* exec = this; exec; exec = exec->m_callingExecState)
     103        exec->scope.mark();
    101104}
    102105
    103106Interpreter* ExecState::lexicalInterpreter() const
    104107{
    105     if (!m_context)
     108    if (scopeChain().isEmpty())
    106109        return dynamicInterpreter();
    107110   
    108     JSObject* object = m_context->scopeChain().bottom();
     111    JSObject* object = scopeChain().bottom();
    109112    if (object && object->isGlobalObject())
    110113        return static_cast<JSGlobalObject*>(object)->interpreter();
     
    113116}
    114117
     118
    115119} // namespace KJS
Note: See TracChangeset for help on using the changeset viewer.