| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 PushOperand(r0); | 1463 PushOperand(r0); |
| 1464 VisitForStackValue(value); | 1464 VisitForStackValue(value); |
| 1465 DCHECK(property->emit_store()); | 1465 DCHECK(property->emit_store()); |
| 1466 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1466 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
| 1467 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1467 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
| 1468 BailoutState::NO_REGISTERS); | 1468 BailoutState::NO_REGISTERS); |
| 1469 break; | 1469 break; |
| 1470 | 1470 |
| 1471 case ObjectLiteral::Property::GETTER: | 1471 case ObjectLiteral::Property::GETTER: |
| 1472 if (property->emit_store()) { | 1472 if (property->emit_store()) { |
| 1473 accessor_table.lookup(key)->second->getter = property; | 1473 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1474 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1475 it->second->getter = property; |
| 1474 } | 1476 } |
| 1475 break; | 1477 break; |
| 1476 case ObjectLiteral::Property::SETTER: | 1478 case ObjectLiteral::Property::SETTER: |
| 1477 if (property->emit_store()) { | 1479 if (property->emit_store()) { |
| 1478 accessor_table.lookup(key)->second->setter = property; | 1480 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1481 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1482 it->second->setter = property; |
| 1479 } | 1483 } |
| 1480 break; | 1484 break; |
| 1481 } | 1485 } |
| 1482 } | 1486 } |
| 1483 | 1487 |
| 1484 // Emit code to define accessors, using only a single call to the runtime for | 1488 // Emit code to define accessors, using only a single call to the runtime for |
| 1485 // each pair of corresponding getters and setters. | 1489 // each pair of corresponding getters and setters. |
| 1486 for (AccessorTable::Iterator it = accessor_table.begin(); | 1490 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1487 it != accessor_table.end(); | 1491 it != accessor_table.end(); |
| 1488 ++it) { | 1492 ++it) { |
| 1489 __ ldr(r0, MemOperand(sp)); // Duplicate receiver. | 1493 __ ldr(r0, MemOperand(sp)); // Duplicate receiver. |
| 1490 PushOperand(r0); | 1494 PushOperand(r0); |
| 1491 VisitForStackValue(it->first); | 1495 VisitForStackValue(it->first); |
| 1492 EmitAccessor(it->second->getter); | 1496 EmitAccessor(it->second->getter); |
| 1493 EmitAccessor(it->second->setter); | 1497 EmitAccessor(it->second->setter); |
| 1494 __ mov(r0, Operand(Smi::FromInt(NONE))); | 1498 __ mov(r0, Operand(Smi::FromInt(NONE))); |
| 1495 PushOperand(r0); | 1499 PushOperand(r0); |
| 1496 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); | 1500 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); |
| 1501 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS); |
| 1497 } | 1502 } |
| 1498 | 1503 |
| 1499 // Object literals have two parts. The "static" part on the left contains no | 1504 // Object literals have two parts. The "static" part on the left contains no |
| 1500 // computed property names, and so we can compute its map ahead of time; see | 1505 // computed property names, and so we can compute its map ahead of time; see |
| 1501 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part | 1506 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part |
| 1502 // starts with the first computed property name, and continues with all | 1507 // starts with the first computed property name, and continues with all |
| 1503 // properties to its right. All the code from above initializes the static | 1508 // properties to its right. All the code from above initializes the static |
| 1504 // component of the object literal, and arranges for the map of the result to | 1509 // component of the object literal, and arranges for the map of the result to |
| 1505 // reflect the static order in which the keys appear. For the dynamic | 1510 // reflect the static order in which the keys appear. For the dynamic |
| 1506 // properties, we compile them into a series of "SetOwnProperty" runtime | 1511 // properties, we compile them into a series of "SetOwnProperty" runtime |
| (...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3840 DCHECK(interrupt_address == | 3845 DCHECK(interrupt_address == |
| 3841 isolate->builtins()->OnStackReplacement()->entry()); | 3846 isolate->builtins()->OnStackReplacement()->entry()); |
| 3842 return ON_STACK_REPLACEMENT; | 3847 return ON_STACK_REPLACEMENT; |
| 3843 } | 3848 } |
| 3844 | 3849 |
| 3845 | 3850 |
| 3846 } // namespace internal | 3851 } // namespace internal |
| 3847 } // namespace v8 | 3852 } // namespace v8 |
| 3848 | 3853 |
| 3849 #endif // V8_TARGET_ARCH_ARM | 3854 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |