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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 __ Push(Smi::FromInt(expr->literal_index())); | 1520 __ Push(Smi::FromInt(expr->literal_index())); |
1521 __ Push(constant_elements); | 1521 __ Push(constant_elements); |
1522 __ Push(Smi::FromInt(expr->ComputeFlags())); | 1522 __ Push(Smi::FromInt(expr->ComputeFlags())); |
1523 __ CallRuntime(Runtime::kCreateArrayLiteral); | 1523 __ CallRuntime(Runtime::kCreateArrayLiteral); |
1524 } else { | 1524 } else { |
1525 __ movp(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1525 __ movp(rax, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1526 __ Move(rbx, Smi::FromInt(expr->literal_index())); | 1526 __ Move(rbx, Smi::FromInt(expr->literal_index())); |
1527 __ Move(rcx, constant_elements); | 1527 __ Move(rcx, constant_elements); |
1528 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); | 1528 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); |
1529 __ CallStub(&stub); | 1529 __ CallStub(&stub); |
| 1530 RestoreContext(); |
1530 } | 1531 } |
1531 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); | 1532 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
1532 | 1533 |
1533 bool result_saved = false; // Is the result saved to the stack? | 1534 bool result_saved = false; // Is the result saved to the stack? |
1534 ZoneList<Expression*>* subexprs = expr->values(); | 1535 ZoneList<Expression*>* subexprs = expr->values(); |
1535 int length = subexprs->length(); | 1536 int length = subexprs->length(); |
1536 | 1537 |
1537 // Emit code to evaluate all the non-constant subexpressions and to store | 1538 // Emit code to evaluate all the non-constant subexpressions and to store |
1538 // them into the newly cloned array. | 1539 // them into the newly cloned array. |
1539 for (int array_index = 0; array_index < length; array_index++) { | 1540 for (int array_index = 0; array_index < length; array_index++) { |
(...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3595 DCHECK_EQ( | 3596 DCHECK_EQ( |
3596 isolate->builtins()->OnStackReplacement()->entry(), | 3597 isolate->builtins()->OnStackReplacement()->entry(), |
3597 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3598 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3598 return ON_STACK_REPLACEMENT; | 3599 return ON_STACK_REPLACEMENT; |
3599 } | 3600 } |
3600 | 3601 |
3601 } // namespace internal | 3602 } // namespace internal |
3602 } // namespace v8 | 3603 } // namespace v8 |
3603 | 3604 |
3604 #endif // V8_TARGET_ARCH_X64 | 3605 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |