1 | // -*- mode: c++; c-basic-offset: 4 -*-
|
---|
2 | /*
|
---|
3 | * Copyright (C) 1999-2001 Harri Porten ([email protected])
|
---|
4 | * Copyright (C) 2001 Peter Kelly ([email protected])
|
---|
5 | * Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
|
---|
6 | *
|
---|
7 | * This library is free software; you can redistribute it and/or
|
---|
8 | * modify it under the terms of the GNU Library General Public
|
---|
9 | * License as published by the Free Software Foundation; either
|
---|
10 | * version 2 of the License, or (at your option) any later version.
|
---|
11 | *
|
---|
12 | * This library is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
15 | * Library General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU Library General Public License
|
---|
18 | * along with this library; see the file COPYING.LIB. If not, write to
|
---|
19 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
---|
20 | * Boston, MA 02110-1301, USA.
|
---|
21 | *
|
---|
22 | */
|
---|
23 |
|
---|
24 | #include "config.h"
|
---|
25 | #include "ExecState.h"
|
---|
26 |
|
---|
27 | #include "JSGlobalObject.h"
|
---|
28 | #include "JSFunction.h"
|
---|
29 | #include "JSString.h"
|
---|
30 | #include "ScopeChainMark.h"
|
---|
31 |
|
---|
32 | namespace KJS {
|
---|
33 |
|
---|
34 | ExecState::ExecState(JSGlobalObject* globalObject, JSObject* globalThisValue, ScopeChainNode* globalScopeChain)
|
---|
35 | : m_globalObject(globalObject)
|
---|
36 | , m_globalThisValue(globalThisValue)
|
---|
37 | , m_exception(0)
|
---|
38 | , m_globalData(globalObject->globalData())
|
---|
39 | , m_prev(0)
|
---|
40 | , m_registerFile(0)
|
---|
41 | , m_scopeChain(globalScopeChain)
|
---|
42 | , m_callFrameOffset(-1)
|
---|
43 | {
|
---|
44 | }
|
---|
45 |
|
---|
46 | ExecState::ExecState(ExecState* exec, RegisterFile* registerFile, ScopeChainNode* scopeChain, int callFrameOffset)
|
---|
47 | : m_globalObject(exec->m_globalObject)
|
---|
48 | , m_globalThisValue(exec->m_globalThisValue)
|
---|
49 | , m_exception(0)
|
---|
50 | , m_globalData(exec->m_globalData)
|
---|
51 | , m_prev(exec)
|
---|
52 | , m_registerFile(registerFile)
|
---|
53 | , m_scopeChain(scopeChain)
|
---|
54 | , m_callFrameOffset(callFrameOffset)
|
---|
55 | {
|
---|
56 | ASSERT(!exec->m_exception);
|
---|
57 | }
|
---|
58 |
|
---|
59 | bool ExecState::isGlobalObject(JSObject* o) const
|
---|
60 | {
|
---|
61 | return o->isGlobalObject();
|
---|
62 | }
|
---|
63 |
|
---|
64 | } // namespace KJS
|
---|