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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1496 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1497 __ push(Immediate(constant_elements)); | 1497 __ push(Immediate(constant_elements)); |
1498 __ push(Immediate(Smi::FromInt(expr->ComputeFlags()))); | 1498 __ push(Immediate(Smi::FromInt(expr->ComputeFlags()))); |
1499 __ CallRuntime(Runtime::kCreateArrayLiteral); | 1499 __ CallRuntime(Runtime::kCreateArrayLiteral); |
1500 } else { | 1500 } else { |
1501 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1501 __ mov(eax, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1502 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); | 1502 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
1503 __ mov(ecx, Immediate(constant_elements)); | 1503 __ mov(ecx, Immediate(constant_elements)); |
1504 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); | 1504 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); |
1505 __ CallStub(&stub); | 1505 __ CallStub(&stub); |
| 1506 RestoreContext(); |
1506 } | 1507 } |
1507 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); | 1508 PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
1508 | 1509 |
1509 bool result_saved = false; // Is the result saved to the stack? | 1510 bool result_saved = false; // Is the result saved to the stack? |
1510 ZoneList<Expression*>* subexprs = expr->values(); | 1511 ZoneList<Expression*>* subexprs = expr->values(); |
1511 int length = subexprs->length(); | 1512 int length = subexprs->length(); |
1512 | 1513 |
1513 // Emit code to evaluate all the non-constant subexpressions and to store | 1514 // Emit code to evaluate all the non-constant subexpressions and to store |
1514 // them into the newly cloned array. | 1515 // them into the newly cloned array. |
1515 for (int array_index = 0; array_index < length; array_index++) { | 1516 for (int array_index = 0; array_index < length; array_index++) { |
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3612 isolate->builtins()->OnStackReplacement()->entry(), | 3613 isolate->builtins()->OnStackReplacement()->entry(), |
3613 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3614 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3614 return ON_STACK_REPLACEMENT; | 3615 return ON_STACK_REPLACEMENT; |
3615 } | 3616 } |
3616 | 3617 |
3617 | 3618 |
3618 } // namespace internal | 3619 } // namespace internal |
3619 } // namespace v8 | 3620 } // namespace v8 |
3620 | 3621 |
3621 #endif // V8_TARGET_ARCH_X87 | 3622 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |