mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 1 | /* |
mark.lam@apple.com | d7c391d | 2016-06-08 20:59:49 +0000 | [diff] [blame] | 2 | * Copyright (C) 2008, 2013, 2015-2016 Apple Inc. All rights reserved. |
commit-queue@webkit.org | d106bf2 | 2012-07-04 21:36:52 +0000 | [diff] [blame] | 3 | * Copyright (C) 2012 Research In Motion Limited. All rights reserved. |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 4 | * |
| 5 | * Redistribution and use in source and binary forms, with or without |
| 6 | * modification, are permitted provided that the following conditions |
| 7 | * are met: |
| 8 | * |
| 9 | * 1. Redistributions of source code must retain the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer. |
| 11 | * 2. Redistributions in binary form must reproduce the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer in the |
| 13 | * documentation and/or other materials provided with the distribution. |
mjs@apple.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 14 | * 3. Neither the name of Apple Inc. ("Apple") nor the names of |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 15 | * its contributors may be used to endorse or promote products derived |
| 16 | * from this software without specific prior written permission. |
| 17 | * |
| 18 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY |
| 19 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY |
| 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | */ |
weinig@apple.com | a963b96 | 2008-06-05 05:36:55 +0000 | [diff] [blame] | 29 | |
ryanhaddad@apple.com | 22104f5 | 2016-09-28 17:08:17 +0000 | [diff] [blame] | 30 | #pragma once |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 31 | |
weinig@apple.com | 49b3250 | 2008-07-06 00:10:04 +0000 | [diff] [blame] | 32 | #include "ArgList.h" |
mark.lam@apple.com | 451de99 | 2016-09-07 22:10:50 +0000 | [diff] [blame] | 33 | #include "CatchScope.h" |
utatane.tea@gmail.com | 4f2f2b2 | 2016-10-18 08:13:26 +0000 | [diff] [blame] | 34 | #include "FrameTracers.h" |
mhahnenberg@apple.com | c1bc9d3 | 2013-01-24 21:39:55 +0000 | [diff] [blame] | 35 | #include "JSCJSValue.h" |
ggaren@apple.com | 1d72f77 | 2008-07-03 00:47:00 +0000 | [diff] [blame] | 36 | #include "JSCell.h" |
ggaren@apple.com | bb63926 | 2009-02-20 06:04:21 +0000 | [diff] [blame] | 37 | #include "JSObject.h" |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 38 | #include "Opcode.h" |
fpizlo@apple.com | bcfd39e | 2015-02-10 23:16:36 +0000 | [diff] [blame] | 39 | #include "StackAlignment.h" |
fpizlo@apple.com | bc16ddb | 2016-09-06 01:02:22 +0000 | [diff] [blame] | 40 | #include "StackFrame.h" |
hausmann@webkit.org | f71db05 | 2009-07-15 15:14:15 +0000 | [diff] [blame] | 41 | #include <wtf/HashMap.h> |
| 42 | |
mark.lam@apple.com | 504b1cc | 2016-07-11 20:48:15 +0000 | [diff] [blame] | 43 | #if !ENABLE(JIT) |
| 44 | #include "CLoopStack.h" |
| 45 | #endif |
| 46 | |
| 47 | |
cwzwarich@webkit.org | 3f782f6 | 2008-09-08 01:28:33 +0000 | [diff] [blame] | 48 | namespace JSC { |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 49 | |
| 50 | class CodeBlock; |
barraclough@apple.com | 83651156 | 2009-08-15 01:14:00 +0000 | [diff] [blame] | 51 | class EvalExecutable; |
barraclough@apple.com | 306bb12 | 2009-08-18 05:34:52 +0000 | [diff] [blame] | 52 | class FunctionExecutable; |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 53 | class VM; |
fpizlo@apple.com | 3a2fa4c | 2015-04-13 22:13:12 +0000 | [diff] [blame] | 54 | class JSFunction; |
oliver@apple.com | c8f3a75 | 2008-06-28 04:02:03 +0000 | [diff] [blame] | 55 | class JSGlobalObject; |
utatane.tea@gmail.com | 6c38958 | 2015-09-04 04:29:04 +0000 | [diff] [blame] | 56 | class JSModuleEnvironment; |
utatane.tea@gmail.com | a8309d9 | 2015-09-01 02:05:30 +0000 | [diff] [blame] | 57 | class JSModuleRecord; |
fpizlo@apple.com | 7bbcaab | 2012-02-22 05:23:19 +0000 | [diff] [blame] | 58 | class LLIntOffsetsExtractor; |
barraclough@apple.com | 83651156 | 2009-08-15 01:14:00 +0000 | [diff] [blame] | 59 | class ProgramExecutable; |
utatane.tea@gmail.com | a8309d9 | 2015-09-01 02:05:30 +0000 | [diff] [blame] | 60 | class ModuleProgramExecutable; |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 61 | class Register; |
ggaren@apple.com | b11e787 | 2012-08-30 22:50:00 +0000 | [diff] [blame] | 62 | class JSScope; |
oliver@apple.com | ef1f5ce | 2009-04-15 07:31:48 +0000 | [diff] [blame] | 63 | struct CallFrameClosure; |
weinig@apple.com | 18064e7 | 2008-12-10 00:26:13 +0000 | [diff] [blame] | 64 | struct HandlerInfo; |
levin@chromium.org | 93604aa | 2009-07-29 08:04:19 +0000 | [diff] [blame] | 65 | struct Instruction; |
msaboff@apple.com | 6f0b31a | 2013-12-04 16:40:17 +0000 | [diff] [blame] | 66 | struct ProtoCallFrame; |
utatane.tea@gmail.com | c258519 | 2016-08-25 22:55:10 +0000 | [diff] [blame] | 67 | struct UnlinkedInstruction; |
msaboff@apple.com | 6f0b31a | 2013-12-04 16:40:17 +0000 | [diff] [blame] | 68 | |
fpizlo@apple.com | bc16ddb | 2016-09-06 01:02:22 +0000 | [diff] [blame] | 69 | enum UnwindStart : uint8_t { UnwindFromCurrentFrame, UnwindFromCallerFrame }; |
mark.lam@apple.com | 4348a43 | 2015-09-07 05:19:28 +0000 | [diff] [blame] | 70 | |
commit-queue@webkit.org | fbca305 | 2016-10-01 15:32:59 +0000 | [diff] [blame] | 71 | enum DebugHookType { |
ggaren@apple.com | d0740c8 | 2008-05-28 20:47:13 +0000 | [diff] [blame] | 72 | WillExecuteProgram, |
| 73 | DidExecuteProgram, |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 74 | DidEnterCallFrame, |
oliver@apple.com | 139b529 | 2008-06-03 22:48:52 +0000 | [diff] [blame] | 75 | DidReachBreakpoint, |
ggaren@apple.com | d0740c8 | 2008-05-28 20:47:13 +0000 | [diff] [blame] | 76 | WillLeaveCallFrame, |
joepeck@webkit.org | bb70ac6 | 2016-09-30 19:22:37 +0000 | [diff] [blame] | 77 | WillExecuteStatement, |
| 78 | WillExecuteExpression, |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 79 | }; |
| 80 | |
oliver@apple.com | ddf4b48 | 2012-02-17 21:17:59 +0000 | [diff] [blame] | 81 | enum StackFrameCodeType { |
| 82 | StackFrameGlobalCode, |
| 83 | StackFrameEvalCode, |
utatane.tea@gmail.com | a8309d9 | 2015-09-01 02:05:30 +0000 | [diff] [blame] | 84 | StackFrameModuleCode, |
oliver@apple.com | ddf4b48 | 2012-02-17 21:17:59 +0000 | [diff] [blame] | 85 | StackFrameFunctionCode, |
| 86 | StackFrameNativeCode |
| 87 | }; |
| 88 | |
ossy@webkit.org | 95c1bc4 | 2011-01-20 16:30:54 +0000 | [diff] [blame] | 89 | class Interpreter { |
| 90 | WTF_MAKE_FAST_ALLOCATED; |
aroben@apple.com | e089d62 | 2012-02-21 16:26:12 +0000 | [diff] [blame] | 91 | friend class CachedCall; |
fpizlo@apple.com | 7bbcaab | 2012-02-22 05:23:19 +0000 | [diff] [blame] | 92 | friend class LLIntOffsetsExtractor; |
| 93 | friend class JIT; |
commit-queue@webkit.org | 3f922f9 | 2013-08-29 00:28:42 +0000 | [diff] [blame] | 94 | friend class VM; |
mark.lam@apple.com | 8b97fde | 2012-10-22 22:09:58 +0000 | [diff] [blame] | 95 | |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 96 | public: |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 97 | Interpreter(VM &); |
fpizlo@apple.com | 7bbcaab | 2012-02-22 05:23:19 +0000 | [diff] [blame] | 98 | ~Interpreter(); |
fpizlo@apple.com | 0afe966 | 2011-12-20 02:42:06 +0000 | [diff] [blame] | 99 | |
mark.lam@apple.com | a6f900b | 2015-08-18 17:37:21 +0000 | [diff] [blame] | 100 | void initialize(); |
barraclough@apple.com | 7c876fc | 2008-11-11 05:09:46 +0000 | [diff] [blame] | 101 | |
mark.lam@apple.com | 504b1cc | 2016-07-11 20:48:15 +0000 | [diff] [blame] | 102 | #if !ENABLE(JIT) |
| 103 | CLoopStack& cloopStack() { return m_cloopStack; } |
| 104 | #endif |
ggaren@apple.com | 82a62d0 | 2008-06-27 22:35:33 +0000 | [diff] [blame] | 105 | |
ggaren@apple.com | 47d3f05 | 2008-11-15 21:37:49 +0000 | [diff] [blame] | 106 | Opcode getOpcode(OpcodeID id) |
ggaren@apple.com | e5af6d5 | 2008-09-26 22:43:16 +0000 | [diff] [blame] | 107 | { |
fpizlo@apple.com | 0afe966 | 2011-12-20 02:42:06 +0000 | [diff] [blame] | 108 | ASSERT(m_initialized); |
commit-queue@webkit.org | b841948 | 2012-08-30 22:21:48 +0000 | [diff] [blame] | 109 | #if ENABLE(COMPUTED_GOTO_OPCODES) |
fpizlo@apple.com | 0afe966 | 2011-12-20 02:42:06 +0000 | [diff] [blame] | 110 | return m_opcodeTable[id]; |
| 111 | #else |
| 112 | return id; |
| 113 | #endif |
ggaren@apple.com | e5af6d5 | 2008-09-26 22:43:16 +0000 | [diff] [blame] | 114 | } |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 115 | |
ggaren@apple.com | 47d3f05 | 2008-11-15 21:37:49 +0000 | [diff] [blame] | 116 | OpcodeID getOpcodeID(Opcode opcode) |
weinig@apple.com | a963b96 | 2008-06-05 05:36:55 +0000 | [diff] [blame] | 117 | { |
fpizlo@apple.com | 0afe966 | 2011-12-20 02:42:06 +0000 | [diff] [blame] | 118 | ASSERT(m_initialized); |
dbatyai.u-szeged@partner.samsung.com | 46f07e5 | 2014-06-19 16:32:31 +0000 | [diff] [blame] | 119 | #if ENABLE(COMPUTED_GOTO_OPCODES) |
fpizlo@apple.com | 0afe966 | 2011-12-20 02:42:06 +0000 | [diff] [blame] | 120 | ASSERT(isOpcode(opcode)); |
fpizlo@apple.com | 7bbcaab | 2012-02-22 05:23:19 +0000 | [diff] [blame] | 121 | return m_opcodeIDTable.get(opcode); |
mark.lam@apple.com | 74a9e83 | 2012-09-25 04:30:20 +0000 | [diff] [blame] | 122 | #else |
fpizlo@apple.com | 0afe966 | 2011-12-20 02:42:06 +0000 | [diff] [blame] | 123 | return opcode; |
mark.lam@apple.com | 74a9e83 | 2012-09-25 04:30:20 +0000 | [diff] [blame] | 124 | #endif |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 125 | } |
utatane.tea@gmail.com | c258519 | 2016-08-25 22:55:10 +0000 | [diff] [blame] | 126 | |
| 127 | OpcodeID getOpcodeID(const Instruction&); |
| 128 | OpcodeID getOpcodeID(const UnlinkedInstruction&); |
| 129 | |
ggaren@apple.com | 47d3f05 | 2008-11-15 21:37:49 +0000 | [diff] [blame] | 130 | bool isOpcode(Opcode); |
barraclough@apple.com | 2607dd0 | 2010-10-27 20:46:09 +0000 | [diff] [blame] | 131 | |
ggaren@apple.com | b11e787 | 2012-08-30 22:50:00 +0000 | [diff] [blame] | 132 | JSValue execute(ProgramExecutable*, CallFrame*, JSObject* thisObj); |
barraclough@apple.com | 2607dd0 | 2010-10-27 20:46:09 +0000 | [diff] [blame] | 133 | JSValue executeCall(CallFrame*, JSObject* function, CallType, const CallData&, JSValue thisValue, const ArgList&); |
utatane.tea@gmail.com | 221fbc4 | 2015-07-22 00:29:39 +0000 | [diff] [blame] | 134 | JSObject* executeConstruct(CallFrame*, JSObject* function, ConstructType, const ConstructData&, const ArgList&, JSValue newTarget); |
ggaren@apple.com | b11e787 | 2012-08-30 22:50:00 +0000 | [diff] [blame] | 135 | JSValue execute(EvalExecutable*, CallFrame*, JSValue thisValue, JSScope*); |
utatane.tea@gmail.com | 6c38958 | 2015-09-04 04:29:04 +0000 | [diff] [blame] | 136 | JSValue execute(ModuleProgramExecutable*, CallFrame*, JSModuleEnvironment*); |
weinig@apple.com | a963b96 | 2008-06-05 05:36:55 +0000 | [diff] [blame] | 137 | |
darin@apple.com | 8c2bac0 | 2008-10-09 00:40:43 +0000 | [diff] [blame] | 138 | void getArgumentsData(CallFrame*, JSFunction*&, ptrdiff_t& firstParameterIndex, Register*& argv, int& argc); |
oliver@apple.com | c8f3a75 | 2008-06-28 04:02:03 +0000 | [diff] [blame] | 139 | |
mark.lam@apple.com | 4348a43 | 2015-09-07 05:19:28 +0000 | [diff] [blame] | 140 | NEVER_INLINE HandlerInfo* unwind(VM&, CallFrame*&, Exception*, UnwindStart); |
saambarati1@gmail.com | 284319e | 2015-09-17 18:30:04 +0000 | [diff] [blame] | 141 | void notifyDebuggerOfExceptionToBeThrown(CallFrame*, Exception*); |
commit-queue@webkit.org | fbca305 | 2016-10-01 15:32:59 +0000 | [diff] [blame] | 142 | NEVER_INLINE void debug(CallFrame*, DebugHookType); |
mark.lam@apple.com | 9f6a2c7 | 2016-06-11 19:58:07 +0000 | [diff] [blame] | 143 | static JSString* stackTraceAsString(VM&, const Vector<StackFrame>&); |
barraclough@apple.com | 5b374fc | 2009-06-02 05:36:18 +0000 | [diff] [blame] | 144 | |
mark.lam@apple.com | b07f4c4 | 2013-08-08 16:38:31 +0000 | [diff] [blame] | 145 | static EncodedJSValue JSC_HOST_CALL constructWithErrorConstructor(ExecState*); |
| 146 | static EncodedJSValue JSC_HOST_CALL callErrorConstructor(ExecState*); |
| 147 | static EncodedJSValue JSC_HOST_CALL constructWithNativeErrorConstructor(ExecState*); |
| 148 | static EncodedJSValue JSC_HOST_CALL callNativeErrorConstructor(ExecState*); |
| 149 | |
oliver@apple.com | a08210b | 2012-07-18 23:26:06 +0000 | [diff] [blame] | 150 | JS_EXPORT_PRIVATE void dumpCallFrame(CallFrame*); |
| 151 | |
mark.lam@apple.com | 9f6a2c7 | 2016-06-11 19:58:07 +0000 | [diff] [blame] | 152 | void getStackTrace(Vector<StackFrame>& results, size_t framesToSkip = 0, size_t maxStackSize = std::numeric_limits<size_t>::max()); |
mmirman@apple.com | c35dac9 | 2015-04-07 21:34:05 +0000 | [diff] [blame] | 153 | |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 154 | private: |
weinig@apple.com | a963b96 | 2008-06-05 05:36:55 +0000 | [diff] [blame] | 155 | enum ExecutionFlag { Normal, InitializeAndReturn }; |
oliver@apple.com | 9a4dea5 | 2009-04-15 07:13:25 +0000 | [diff] [blame] | 156 | |
msaboff@apple.com | 6f0b31a | 2013-12-04 16:40:17 +0000 | [diff] [blame] | 157 | CallFrameClosure prepareForRepeatCall(FunctionExecutable*, CallFrame*, ProtoCallFrame*, JSFunction*, int argumentCountIncludingThis, JSScope*, JSValue*); |
mark.lam@apple.com | afeead1 | 2013-12-05 20:33:35 +0000 | [diff] [blame] | 158 | |
barraclough@apple.com | 2607dd0 | 2010-10-27 20:46:09 +0000 | [diff] [blame] | 159 | JSValue execute(CallFrameClosure&); |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 160 | |
mmirman@apple.com | c35dac9 | 2015-04-07 21:34:05 +0000 | [diff] [blame] | 161 | |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 162 | |
ggaren@apple.com | 68313b0 | 2008-11-13 00:48:23 +0000 | [diff] [blame] | 163 | void dumpRegisters(CallFrame*); |
ggaren@apple.com | 4b8c0fb | 2008-10-20 16:48:30 +0000 | [diff] [blame] | 164 | |
msaboff@apple.com | c15ae7e | 2015-09-16 23:40:35 +0000 | [diff] [blame] | 165 | bool isCallBytecode(Opcode opcode) { return opcode == getOpcode(op_call) || opcode == getOpcode(op_construct) || opcode == getOpcode(op_call_eval) || opcode == getOpcode(op_tail_call); } |
mrowe@apple.com | f88a463 | 2008-09-07 05:44:58 +0000 | [diff] [blame] | 166 | |
oliver@apple.com | e0b15ee | 2013-07-25 04:01:06 +0000 | [diff] [blame] | 167 | VM& m_vm; |
mark.lam@apple.com | 504b1cc | 2016-07-11 20:48:15 +0000 | [diff] [blame] | 168 | #if !ENABLE(JIT) |
| 169 | CLoopStack m_cloopStack; |
| 170 | #endif |
mark.lam@apple.com | 8b97fde | 2012-10-22 22:09:58 +0000 | [diff] [blame] | 171 | int m_errorHandlingModeReentry; |
ggaren@apple.com | 1d72f77 | 2008-07-03 00:47:00 +0000 | [diff] [blame] | 172 | |
dbatyai.u-szeged@partner.samsung.com | 46f07e5 | 2014-06-19 16:32:31 +0000 | [diff] [blame] | 173 | #if ENABLE(COMPUTED_GOTO_OPCODES) |
fpizlo@apple.com | 7bbcaab | 2012-02-22 05:23:19 +0000 | [diff] [blame] | 174 | Opcode* m_opcodeTable; // Maps OpcodeID => Opcode for compiling |
| 175 | HashMap<Opcode, OpcodeID> m_opcodeIDTable; // Maps Opcode => OpcodeID for decompiling |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 176 | #endif |
fpizlo@apple.com | 0afe966 | 2011-12-20 02:42:06 +0000 | [diff] [blame] | 177 | |
| 178 | #if !ASSERT_DISABLED |
| 179 | bool m_initialized; |
| 180 | #endif |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 181 | }; |
barraclough@apple.com | 19afece | 2011-07-15 19:51:49 +0000 | [diff] [blame] | 182 | |
ggaren@apple.com | 539d1bb | 2011-11-14 19:21:40 +0000 | [diff] [blame] | 183 | JSValue eval(CallFrame*); |
fpizlo@apple.com | bcfd39e | 2015-02-10 23:16:36 +0000 | [diff] [blame] | 184 | |
| 185 | inline CallFrame* calleeFrameForVarargs(CallFrame* callFrame, unsigned numUsedStackSlots, unsigned argumentCountIncludingThis) |
| 186 | { |
msaboff@apple.com | c15ae7e | 2015-09-16 23:40:35 +0000 | [diff] [blame] | 187 | // We want the new frame to be allocated on a stack aligned offset with a stack |
| 188 | // aligned size. Align the size here. |
| 189 | argumentCountIncludingThis = WTF::roundUpToMultipleOf( |
| 190 | stackAlignmentRegisters(), |
mark.lam@apple.com | 2bd8934 | 2016-07-08 22:58:15 +0000 | [diff] [blame] | 191 | argumentCountIncludingThis + CallFrame::headerSizeInRegisters) - CallFrame::headerSizeInRegisters; |
msaboff@apple.com | c15ae7e | 2015-09-16 23:40:35 +0000 | [diff] [blame] | 192 | |
| 193 | // Align the frame offset here. |
fpizlo@apple.com | bcfd39e | 2015-02-10 23:16:36 +0000 | [diff] [blame] | 194 | unsigned paddedCalleeFrameOffset = WTF::roundUpToMultipleOf( |
| 195 | stackAlignmentRegisters(), |
mark.lam@apple.com | 2bd8934 | 2016-07-08 22:58:15 +0000 | [diff] [blame] | 196 | numUsedStackSlots + argumentCountIncludingThis + CallFrame::headerSizeInRegisters); |
fpizlo@apple.com | bcfd39e | 2015-02-10 23:16:36 +0000 | [diff] [blame] | 197 | return CallFrame::create(callFrame->registers() - paddedCalleeFrameOffset); |
| 198 | } |
| 199 | |
fpizlo@apple.com | 8fefdd3 | 2015-02-18 19:55:47 +0000 | [diff] [blame] | 200 | unsigned sizeOfVarargs(CallFrame* exec, JSValue arguments, uint32_t firstVarArgOffset); |
fpizlo@apple.com | da834ae | 2015-03-26 04:28:43 +0000 | [diff] [blame] | 201 | static const unsigned maxArguments = 0x10000; |
mark.lam@apple.com | 504b1cc | 2016-07-11 20:48:15 +0000 | [diff] [blame] | 202 | unsigned sizeFrameForVarargs(CallFrame* exec, VM&, JSValue arguments, unsigned numUsedStackSlots, uint32_t firstVarArgOffset); |
| 203 | unsigned sizeFrameForForwardArguments(CallFrame* exec, VM&, unsigned numUsedStackSlots); |
fpizlo@apple.com | bcfd39e | 2015-02-10 23:16:36 +0000 | [diff] [blame] | 204 | void loadVarargs(CallFrame* execCaller, VirtualRegister firstElementDest, JSValue source, uint32_t offset, uint32_t length); |
| 205 | void setupVarargsFrame(CallFrame* execCaller, CallFrame* execCallee, JSValue arguments, uint32_t firstVarArgOffset, uint32_t length); |
| 206 | void setupVarargsFrameAndSetThis(CallFrame* execCaller, CallFrame* execCallee, JSValue thisValue, JSValue arguments, uint32_t firstVarArgOffset, uint32_t length); |
keith_miller@apple.com | e497e20 | 2016-06-13 21:05:36 +0000 | [diff] [blame] | 207 | void setupForwardArgumentsFrame(CallFrame* execCaller, CallFrame* execCallee, uint32_t length); |
| 208 | void setupForwardArgumentsFrameAndSetThis(CallFrame* execCaller, CallFrame* execCallee, JSValue thisValue, uint32_t length); |
fpizlo@apple.com | 74485fb | 2015-02-10 03:27:43 +0000 | [diff] [blame] | 209 | |
cwzwarich@webkit.org | 3f782f6 | 2008-09-08 01:28:33 +0000 | [diff] [blame] | 210 | } // namespace JSC |