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/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 DCHECK_EQ(scope(), info->scope()); | 254 DCHECK_EQ(scope(), info->scope()); |
255 Variable* arguments = info->scope()->arguments(); | 255 Variable* arguments = info->scope()->arguments(); |
256 if (arguments != NULL) { | 256 if (arguments != NULL) { |
257 // Arguments object must be allocated after the context object, in | 257 // Arguments object must be allocated after the context object, in |
258 // case the "arguments" or ".arguments" variables are in the context. | 258 // case the "arguments" or ".arguments" variables are in the context. |
259 Comment cmnt(masm_, "[ Allocate arguments object"); | 259 Comment cmnt(masm_, "[ Allocate arguments object"); |
260 if (!function_in_register) { | 260 if (!function_in_register) { |
261 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 261 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
262 } | 262 } |
263 if (is_strict(language_mode()) || !has_simple_parameters()) { | 263 if (is_strict(language_mode()) || !has_simple_parameters()) { |
264 FastNewStrictArgumentsStub stub(isolate()); | 264 __ call(isolate()->builtins()->FastNewStrictArguments(), |
265 __ CallStub(&stub); | 265 RelocInfo::CODE_TARGET); |
| 266 RestoreContext(); |
266 } else if (literal()->has_duplicate_parameters()) { | 267 } else if (literal()->has_duplicate_parameters()) { |
267 __ Push(rdi); | 268 __ Push(rdi); |
268 __ CallRuntime(Runtime::kNewSloppyArguments_Generic); | 269 __ CallRuntime(Runtime::kNewSloppyArguments_Generic); |
269 } else { | 270 } else { |
270 FastNewSloppyArgumentsStub stub(isolate()); | 271 __ call(isolate()->builtins()->FastNewSloppyArguments(), |
271 __ CallStub(&stub); | 272 RelocInfo::CODE_TARGET); |
| 273 RestoreContext(); |
272 } | 274 } |
273 | 275 |
274 SetVar(arguments, rax, rbx, rdx); | 276 SetVar(arguments, rax, rbx, rdx); |
275 } | 277 } |
276 | 278 |
277 if (FLAG_trace) { | 279 if (FLAG_trace) { |
278 __ CallRuntime(Runtime::kTraceEnter); | 280 __ CallRuntime(Runtime::kTraceEnter); |
279 } | 281 } |
280 | 282 |
281 // Visit the declarations and body unless there is an illegal | 283 // Visit the declarations and body unless there is an illegal |
(...skipping 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2763 DCHECK_EQ( | 2765 DCHECK_EQ( |
2764 isolate->builtins()->OnStackReplacement()->entry(), | 2766 isolate->builtins()->OnStackReplacement()->entry(), |
2765 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2767 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2766 return ON_STACK_REPLACEMENT; | 2768 return ON_STACK_REPLACEMENT; |
2767 } | 2769 } |
2768 | 2770 |
2769 } // namespace internal | 2771 } // namespace internal |
2770 } // namespace v8 | 2772 } // namespace v8 |
2771 | 2773 |
2772 #endif // V8_TARGET_ARCH_X64 | 2774 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |