OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 Label loop, entry; | 178 Label loop, entry; |
179 __ movp(rcx, rax); | 179 __ movp(rcx, rax); |
180 __ jmp(&entry); | 180 __ jmp(&entry); |
181 __ bind(&loop); | 181 __ bind(&loop); |
182 __ Push(Operand(rbx, rcx, times_pointer_size, 0)); | 182 __ Push(Operand(rbx, rcx, times_pointer_size, 0)); |
183 __ bind(&entry); | 183 __ bind(&entry); |
184 __ decp(rcx); | 184 __ decp(rcx); |
185 __ j(greater_equal, &loop); | 185 __ j(greater_equal, &loop); |
186 | 186 |
187 // Call the function. | 187 // Call the function. |
188 if (is_api_function) { | 188 ParameterCount actual(rax); |
189 __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset)); | 189 __ InvokeFunction(rdi, rdx, actual, CALL_FUNCTION, |
190 Handle<Code> code = | 190 CheckDebugStepCallWrapper()); |
191 masm->isolate()->builtins()->HandleApiCallConstruct(); | |
192 __ Call(code, RelocInfo::CODE_TARGET); | |
193 } else { | |
194 ParameterCount actual(rax); | |
195 __ InvokeFunction(rdi, rdx, actual, CALL_FUNCTION, | |
196 CheckDebugStepCallWrapper()); | |
197 } | |
198 | 191 |
199 // Store offset of return address for deoptimizer. | 192 // Store offset of return address for deoptimizer. |
200 if (create_implicit_receiver && !is_api_function) { | 193 if (create_implicit_receiver && !is_api_function) { |
201 masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset()); | 194 masm->isolate()->heap()->SetConstructStubDeoptPCOffset(masm->pc_offset()); |
202 } | 195 } |
203 | 196 |
204 // Restore context from the frame. | 197 // Restore context from the frame. |
205 __ movp(rsi, Operand(rbp, ConstructFrameConstants::kContextOffset)); | 198 __ movp(rsi, Operand(rbp, ConstructFrameConstants::kContextOffset)); |
206 | 199 |
207 if (create_implicit_receiver) { | 200 if (create_implicit_receiver) { |
(...skipping 2724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2932 __ ret(0); | 2925 __ ret(0); |
2933 } | 2926 } |
2934 | 2927 |
2935 | 2928 |
2936 #undef __ | 2929 #undef __ |
2937 | 2930 |
2938 } // namespace internal | 2931 } // namespace internal |
2939 } // namespace v8 | 2932 } // namespace v8 |
2940 | 2933 |
2941 #endif // V8_TARGET_ARCH_X64 | 2934 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |