Debian Codegraph @

src/3rdparty/javascriptcore/JavaScriptCore/interpreter/CallFrame.h

raw symbols SCIP
1 /*
2 * Copyright (C) 1999-2001 Harri Porten ([email protected])
3 * Copyright (C) 2001 Peter Kelly ([email protected])
4 * Copyright (C) 2003, 2007, 2008 Apple Inc. All rights reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23 #ifndef CallFrame_h
24 #define CallFrame_hcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/interpreter/CallFrame.h:24:9`!
25
26 #include "JSGlobalData.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h`/
27 #include "RegisterFile.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/interpreter/RegisterFile.h`/
28 #include "ScopeChain.h"cxx . . $ `<file>/src/3rdparty/javascriptcore/JavaScriptCore/runtime/ScopeChain.h`/
29
30 namespace JSCcxx . . $ `<built-in>:463:9`! {
31
32 class Argumentscxx . . $ QTJSC/Arguments#;
33 class JSActivationcxx . . $ QTJSC/JSActivation#;
34 class Interpretercxx . . $ QTJSC/Interpreter#;
35
36 // Represents the current state of script execution.
37 // Passed as the first argument to most functions.
38 class ExecStatecxx . . $ QTJSC/ExecState# : private Registercxx . . $ QTJSC/Register# {
39 public:
40 JSObjectcxx . . $ QTJSC/JSObject#* calleecxx . . $ QTJSC/ExecState#callee(8ac23ea934d7a115).() const { return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::Calleecxx . . $ QTJSC/RegisterFile#Callee.].objectcxx . . $ QTJSC/Register#object(8ac23ea934d7a115).(); }
41 CodeBlockcxx . . $ QTJSC/CodeBlock#* codeBlockcxx . . $ QTJSC/ExecState#codeBlock(a218112474fb222a).() const { return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::CodeBlockcxx . . $ QTJSC/RegisterFile#CodeBlock.].Registercxx . . $ QTJSC/Register#::codeBlockcxx . . $ QTJSC/Register#codeBlock(a218112474fb222a).(); }
42 ScopeChainNodecxx . . $ QTJSC/ScopeChainNode#* scopeChaincxx . . $ QTJSC/ExecState#scopeChain(7483ce9f56294eec).() const
43 {
44 ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(this[RegisterFile::ScopeChain].Register::scopeChain());
45 return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::ScopeChaincxx . . $ QTJSC/RegisterFile#ScopeChain.].Registercxx . . $ QTJSC/Register#::scopeChaincxx . . $ QTJSC/Register#scopeChain(7483ce9f56294eec).();
46 }
47 int argumentCountcxx . . $ QTJSC/ExecState#argumentCount(455f465bc33b4cdf).() const { return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::ArgumentCountcxx . . $ QTJSC/RegisterFile#ArgumentCount.].icxx . . $ QTJSC/Register#i(455f465bc33b4cdf).(); }
48
49 JSValuecxx . . $ QTJSC/JSValue# thisValuecxx . . $ QTJSC/ExecState#thisValue(ad9afe69d7bf6378).();
50
51 // Global object in which execution began.
52 JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#* dynamicGlobalObjectcxx . . $ QTJSC/ExecState#dynamicGlobalObject(4418983463e2bc6a).();
53
54 // Global object in which the currently executing code was defined.
55 // Differs from dynamicGlobalObject() during function calls across web browser frames.
56 JSGlobalObjectcxx . . $ QTJSC/JSGlobalObject#* lexicalGlobalObjectcxx . . $ QTJSC/ExecState#lexicalGlobalObject(3d50c730b5e26899).() const
57 {
58 return scopeChaincxx . . $ QTJSC/ExecState#scopeChain(7483ce9f56294eec).()->globalObjectcxx . . $ QTJSC/ScopeChainNode#globalObject.;
59 }
60
61 // Differs from lexicalGlobalObject because this will have DOM window shell rather than
62 // the actual DOM window, which can't be "this" for security reasons.
63 JSObjectcxx . . $ QTJSC/JSObject#* globalThisValuecxx . . $ QTJSC/ExecState#globalThisValue(8ac23ea934d7a115).() const
64 {
65 return scopeChaincxx . . $ QTJSC/ExecState#scopeChain(7483ce9f56294eec).()->globalThiscxx . . $ QTJSC/ScopeChainNode#globalThis.;
66 }
67
68 // FIXME: Elsewhere, we use JSGlobalData* rather than JSGlobalData&.
69 // We should make this more uniform and either use a reference everywhere
70 // or a pointer everywhere.
71 JSGlobalDatacxx . . $ QTJSC/JSGlobalData#& globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).() const
72 {
73 ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(scopeChain()->globalData);
74 return *scopeChaincxx . . $ QTJSC/ExecState#scopeChain(7483ce9f56294eec).()->globalDatacxx . . $ QTJSC/ScopeChainNode#globalData.;
75 }
76
77 // Convenience functions for access to global data.
78 // It takes a few memory references to get from a call frame to the global data
79 // pointer, so these are inefficient, and should be used sparingly in new code.
80 // But they're used in many places in legacy code, so they're not going away any time soon.
81
82 void setExceptioncxx . . $ QTJSC/ExecState#setException(5c2ac18db087b3e6).(JSValuecxx . . $ QTJSC/JSValue# exception) { globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().exceptioncxx . . $ QTJSC/JSGlobalData#exception. =cxx . . $ QTJSC/JSValue#`operator=`(af0e8a528f82a1b5). exception; }
83 void clearExceptioncxx . . $ QTJSC/ExecState#clearException(49f6e7a06ebc5aa8).() { globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().exceptioncxx . . $ QTJSC/JSGlobalData#exception. =cxx . . $ QTJSC/JSValue#`operator=`(5dfb8b6405afb35f). JSValuecxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).(); }
84 JSValuecxx . . $ QTJSC/JSValue# exceptioncxx . . $ QTJSC/ExecState#exception(888c053acf364da1).() const { return globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().exceptioncxx . . $ QTJSC/JSGlobalData#exception.; }
85 JSValuecxx . . $ QTJSC/JSValue#* exceptionSlotcxx . . $ QTJSC/ExecState#exceptionSlot(6880e523701d9eaa).() { return &globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().exceptioncxx . . $ QTJSC/JSGlobalData#exception.; }
86 bool hadExceptioncxx . . $ QTJSC/ExecState#hadException(50ce9a9e25b4a850).() const { return globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().exceptioncxx . . $ QTJSC/JSGlobalData#exception.; }
87
88 const CommonIdentifierscxx . . $ QTJSC/CommonIdentifiers#& propertyNamescxx . . $ QTJSC/ExecState#propertyNames(16296db726e31f87).() const { return *globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().propertyNamescxx . . $ QTJSC/JSGlobalData#propertyNames.; }
89 const MarkedArgumentBuffercxx . . $ QTJSC/MarkedArgumentBuffer#& emptyListcxx . . $ QTJSC/ExecState#emptyList(2af1302b5585147a).() const { return *globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().emptyListcxx . . $ QTJSC/JSGlobalData#emptyList.; }
90 Interpretercxx . . $ QTJSC/Interpreter#* interpretercxx . . $ QTJSC/ExecState#interpreter(6574b75232d5177f).() { return globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().interpretercxx . . $ QTJSC/JSGlobalData#interpreter.; }
91 Heapcxx . . $ QTJSC/Heap#* heapcxx . . $ QTJSC/ExecState#heap(56d7b0fd64ccd56f).() { return &globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().heap; }
92 #ifndef NDEBUGcxx . . $ `<built-in>:472:9`!
93 void dumpCaller();
94 #endif
95 static const HashTablecxx . . $ QTJSC/HashTable#* arrayTablecxx . . $ QTJSC/ExecState#arrayTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().arrayTablecxx . . $ QTJSC/JSGlobalData#arrayTable.; }
96 static const HashTablecxx . . $ QTJSC/HashTable#* dateTablecxx . . $ QTJSC/ExecState#dateTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().dateTablecxx . . $ QTJSC/JSGlobalData#dateTable.; }
97 static const HashTablecxx . . $ QTJSC/HashTable#* jsonTablecxx . . $ QTJSC/ExecState#jsonTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().jsonTablecxx . . $ QTJSC/JSGlobalData#jsonTable.; }
98 static const HashTablecxx . . $ QTJSC/HashTable#* mathTablecxx . . $ QTJSC/ExecState#mathTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().mathTablecxx . . $ QTJSC/JSGlobalData#mathTable.; }
99 static const HashTablecxx . . $ QTJSC/HashTable#* numberTablecxx . . $ QTJSC/ExecState#numberTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().numberTablecxx . . $ QTJSC/JSGlobalData#numberTable.; }
100 static const HashTablecxx . . $ QTJSC/HashTable#* regExpTablecxx . . $ QTJSC/ExecState#regExpTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().regExpTablecxx . . $ QTJSC/JSGlobalData#regExpTable.; }
101 static const HashTablecxx . . $ QTJSC/HashTable#* regExpConstructorTablecxx . . $ QTJSC/ExecState#regExpConstructorTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().regExpConstructorTablecxx . . $ QTJSC/JSGlobalData#regExpConstructorTable.; }
102 static const HashTablecxx . . $ QTJSC/HashTable#* stringTablecxx . . $ QTJSC/ExecState#stringTable(3f6af30e59383ee).(CallFramecxx . . $ QTJSC/CallFrame#* callFrame) { return callFrame->globalDatacxx . . $ QTJSC/ExecState#globalData(ae00a65ac2fd4a61).().stringTablecxx . . $ QTJSC/JSGlobalData#stringTable.; }
103
104 static CallFramecxx . . $ QTJSC/CallFrame#* createcxx . . $ QTJSC/ExecState#create(38d04c2988512828).(Registercxx . . $ QTJSC/Register#* callFrameBase) { return static_cast<CallFramecxx . . $ QTJSC/CallFrame#*>(callFrameBase); }
105 Registercxx . . $ QTJSC/Register#* registerscxx . . $ QTJSC/ExecState#registers(b2e4df52de7a0262).() { return this; }
106
107 CallFramecxx . . $ QTJSC/CallFrame#& operatorcxx . . $ QTJSC/ExecState#`operator=`(91bc5322f0e4475b).=(const Registercxx . . $ QTJSC/Register#& r) { *static_cast<Registercxx . . $ QTJSC/Register#*>(this) =cxx . . $ QTJSC/Register#`operator=`(46bd610ee0b85185). r; return *this; }
108
109 CallFramecxx . . $ QTJSC/CallFrame#* callerFramecxx . . $ QTJSC/ExecState#callerFrame(5952b97f5bc87321).() const { return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::CallerFramecxx . . $ QTJSC/RegisterFile#CallerFrame.].callFramecxx . . $ QTJSC/Register#callFrame(5952b97f5bc87321).(); }
110 Argumentscxx . . $ QTJSC/Arguments#* optionalCalleeArgumentscxx . . $ QTJSC/ExecState#optionalCalleeArguments(66a58788709e4d3d).() const { return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::OptionalCalleeArgumentscxx . . $ QTJSC/RegisterFile#OptionalCalleeArguments.].argumentscxx . . $ QTJSC/Register#arguments(66a58788709e4d3d).(); }
111 Instructioncxx . . $ QTJSC/Instruction#* returnPCcxx . . $ QTJSC/ExecState#returnPC(62fbc1600eb00a5f).() const { return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::ReturnPCcxx . . $ QTJSC/RegisterFile#ReturnPC.].vPCcxx . . $ QTJSC/Register#vPC(62fbc1600eb00a5f).(); }
112
113 void setCalleeArgumentscxx . . $ QTJSC/ExecState#setCalleeArguments(5c2ac18db087b3e6).(JSValuecxx . . $ QTJSC/JSValue# arguments) { static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::OptionalCalleeArgumentscxx . . $ QTJSC/RegisterFile#OptionalCalleeArguments.] =cxx . . $ QTJSC/Register#`operator=`(812d218e081e87f4). arguments; }
114 void setCallerFramecxx . . $ QTJSC/ExecState#setCallerFrame(d2cb180e190a9680).(CallFramecxx . . $ QTJSC/CallFrame#* callerFrame) { static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::CallerFramecxx . . $ QTJSC/RegisterFile#CallerFrame.] =cxx . . $ QTJSC/Register#`operator=`(60763e52b19abfd9). callerFrame; }
115 void setScopeChaincxx . . $ QTJSC/ExecState#setScopeChain(fdc7869371484d42).(ScopeChainNodecxx . . $ QTJSC/ScopeChainNode#* scopeChain) { static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::ScopeChaincxx . . $ QTJSC/RegisterFile#ScopeChain.] =cxx . . $ QTJSC/Register#`operator=`(6d360d5924ad818e). scopeChain; }
116
117 ALWAYS_INLINEcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/AlwaysInline.h:25:9`! void initcxx . . $ QTJSC/ExecState#init(cc3691f9f6ec8d44).(CodeBlockcxx . . $ QTJSC/CodeBlock#* codeBlock, Instructioncxx . . $ QTJSC/Instruction#* vPC, ScopeChainNodecxx . . $ QTJSC/ScopeChainNode#* scopeChain,
118 CallFramecxx . . $ QTJSC/CallFrame#* callerFrame, int returnValueRegister, int argc, JSObjectcxx . . $ QTJSC/JSObject#* callee)
119 {
120 ASSERTcxx . . $ `src/3rdparty/javascriptcore/JavaScriptCore/wtf/Assertions.h:184:9`!(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller.
121
122 setCodeBlockcxx . . $ QTJSC/ExecState#setCodeBlock(d4989c577739c98f).(codeBlock);
123 setScopeChaincxx . . $ QTJSC/ExecState#setScopeChain(fdc7869371484d42).(scopeChain);
124 setCallerFramecxx . . $ QTJSC/ExecState#setCallerFrame(d2cb180e190a9680).(callerFrame);
125 static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::ReturnPCcxx . . $ QTJSC/RegisterFile#ReturnPC.] =cxx . . $ QTJSC/Register#`operator=`(471280538f82a0). vPC; // This is either an Instruction* or a pointer into JIT generated code stored as an Instruction*.
126 static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::ReturnValueRegistercxx . . $ QTJSC/RegisterFile#ReturnValueRegister.] =cxx . . $ QTJSC/Register#`operator=`(7e82ae731ad175a). Registercxx . . $ QTJSC/Register#::withIntcxx . . $ QTJSC/Register#withInt(56c5ad1e8d95a0cb).(returnValueRegister);
127 setArgumentCountcxx . . $ QTJSC/ExecState#setArgumentCount(d4f767463ce0a6b3).(argc); // original argument count (for the sake of the "arguments" object)
128 setCalleecxx . . $ QTJSC/ExecState#setCallee(aa1c69ebc68b9201).(callee);
129 setCalleeArgumentscxx . . $ QTJSC/ExecState#setCalleeArguments(5c2ac18db087b3e6).(JSValuecxx . . $ QTJSC/JSValue#JSValue(49f6e7a06ebc5aa8).());
130 }
131
132 // Read a register from the codeframe (or constant from the CodeBlock).
133 inline Registercxx . . $ QTJSC/Register#& rcxx . . $ QTJSC/ExecState#r(a4e11caf1b71f23c).(int);
134
135 static CallFramecxx . . $ QTJSC/CallFrame#* noCallercxx . . $ QTJSC/ExecState#noCaller(27c3d7386a195136).() { return reinterpret_cast<CallFramecxx . . $ QTJSC/CallFrame#*>(HostCallFrameFlagcxx . . $ QTJSC/ExecState#HostCallFrameFlag.); }
136 int returnValueRegistercxx . . $ QTJSC/ExecState#returnValueRegister(455f465bc33b4cdf).() const { return this[RegisterFilecxx . . $ QTJSC/RegisterFile#::ReturnValueRegistercxx . . $ QTJSC/RegisterFile#ReturnValueRegister.].icxx . . $ QTJSC/Register#i(455f465bc33b4cdf).(); }
137
138 bool hasHostCallFrameFlagcxx . . $ QTJSC/ExecState#hasHostCallFrameFlag(50ce9a9e25b4a850).() const { return reinterpret_cast<intptr_tcxx . . $ intptr_t#>(this) & HostCallFrameFlagcxx . . $ QTJSC/ExecState#HostCallFrameFlag.; }
139 CallFramecxx . . $ QTJSC/CallFrame#* addHostCallFrameFlagcxx . . $ QTJSC/ExecState#addHostCallFrameFlag(5952b97f5bc87321).() const { return reinterpret_cast<CallFramecxx . . $ QTJSC/CallFrame#*>(reinterpret_cast<intptr_tcxx . . $ intptr_t#>(this) | HostCallFrameFlagcxx . . $ QTJSC/ExecState#HostCallFrameFlag.); }
140 CallFramecxx . . $ QTJSC/CallFrame#* removeHostCallFrameFlagcxx . . $ QTJSC/ExecState#removeHostCallFrameFlag(27c3d7386a195136).() { return reinterpret_cast<CallFramecxx . . $ QTJSC/CallFrame#*>(reinterpret_cast<intptr_tcxx . . $ intptr_t#>(this) & ~HostCallFrameFlagcxx . . $ QTJSC/ExecState#HostCallFrameFlag.); }
141
142 private:
143 void setArgumentCountcxx . . $ QTJSC/ExecState#setArgumentCount(d4f767463ce0a6b3).(int count) { static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::ArgumentCountcxx . . $ QTJSC/RegisterFile#ArgumentCount.] =cxx . . $ QTJSC/Register#`operator=`(7e82ae731ad175a). Registercxx . . $ QTJSC/Register#::withIntcxx . . $ QTJSC/Register#withInt(56c5ad1e8d95a0cb).(count); }
144 void setCalleecxx . . $ QTJSC/ExecState#setCallee(aa1c69ebc68b9201).(JSObjectcxx . . $ QTJSC/JSObject#* callee) { static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::Calleecxx . . $ QTJSC/RegisterFile#Callee.] =cxx . . $ QTJSC/Register#`operator=`(bc970bf95e46cc8). callee; }
145 void setCodeBlockcxx . . $ QTJSC/ExecState#setCodeBlock(d4989c577739c98f).(CodeBlockcxx . . $ QTJSC/CodeBlock#* codeBlock) { static_cast<Registercxx . . $ QTJSC/Register#*>(this)[RegisterFilecxx . . $ QTJSC/RegisterFile#::CodeBlockcxx . . $ QTJSC/RegisterFile#CodeBlock.] =cxx . . $ QTJSC/Register#`operator=`(7c444e145edd332d). codeBlock; }
146
147 static const intptr_tcxx . . $ intptr_t# HostCallFrameFlagcxx . . $ QTJSC/ExecState#HostCallFrameFlag. = 1;
148
149 ExecStatecxx . . $ QTJSC/ExecState#ExecState(49f6e7a06ebc5aa8).();
150 ~cxx . . $ QTJSC/ExecState#`~ExecState`(49f6e7a06ebc5aa8).ExecStatecxx . . $ QTJSC/ExecState#();
151 };
152
153 } // namespace JSC
154
155 #endif // CallFrame_h