| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1455 // Duplicate receiver on stack. | 1455 // Duplicate receiver on stack. |
| 1456 __ Peek(x0, 0); | 1456 __ Peek(x0, 0); |
| 1457 PushOperand(x0); | 1457 PushOperand(x0); |
| 1458 VisitForStackValue(value); | 1458 VisitForStackValue(value); |
| 1459 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1459 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
| 1460 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1460 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
| 1461 BailoutState::NO_REGISTERS); | 1461 BailoutState::NO_REGISTERS); |
| 1462 break; | 1462 break; |
| 1463 case ObjectLiteral::Property::GETTER: | 1463 case ObjectLiteral::Property::GETTER: |
| 1464 if (property->emit_store()) { | 1464 if (property->emit_store()) { |
| 1465 accessor_table.lookup(key)->second->getter = property; | 1465 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1466 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1467 it->second->getter = property; |
| 1466 } | 1468 } |
| 1467 break; | 1469 break; |
| 1468 case ObjectLiteral::Property::SETTER: | 1470 case ObjectLiteral::Property::SETTER: |
| 1469 if (property->emit_store()) { | 1471 if (property->emit_store()) { |
| 1470 accessor_table.lookup(key)->second->setter = property; | 1472 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1473 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1474 it->second->setter = property; |
| 1471 } | 1475 } |
| 1472 break; | 1476 break; |
| 1473 } | 1477 } |
| 1474 } | 1478 } |
| 1475 | 1479 |
| 1476 // Emit code to define accessors, using only a single call to the runtime for | 1480 // Emit code to define accessors, using only a single call to the runtime for |
| 1477 // each pair of corresponding getters and setters. | 1481 // each pair of corresponding getters and setters. |
| 1478 for (AccessorTable::Iterator it = accessor_table.begin(); | 1482 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1479 it != accessor_table.end(); | 1483 it != accessor_table.end(); |
| 1480 ++it) { | 1484 ++it) { |
| 1481 __ Peek(x10, 0); // Duplicate receiver. | 1485 __ Peek(x10, 0); // Duplicate receiver. |
| 1482 PushOperand(x10); | 1486 PushOperand(x10); |
| 1483 VisitForStackValue(it->first); | 1487 VisitForStackValue(it->first); |
| 1484 EmitAccessor(it->second->getter); | 1488 EmitAccessor(it->second->getter); |
| 1485 EmitAccessor(it->second->setter); | 1489 EmitAccessor(it->second->setter); |
| 1486 __ Mov(x10, Smi::FromInt(NONE)); | 1490 __ Mov(x10, Smi::FromInt(NONE)); |
| 1487 PushOperand(x10); | 1491 PushOperand(x10); |
| 1488 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); | 1492 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); |
| 1493 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS); |
| 1489 } | 1494 } |
| 1490 | 1495 |
| 1491 // Object literals have two parts. The "static" part on the left contains no | 1496 // Object literals have two parts. The "static" part on the left contains no |
| 1492 // computed property names, and so we can compute its map ahead of time; see | 1497 // computed property names, and so we can compute its map ahead of time; see |
| 1493 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part | 1498 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part |
| 1494 // starts with the first computed property name, and continues with all | 1499 // starts with the first computed property name, and continues with all |
| 1495 // properties to its right. All the code from above initializes the static | 1500 // properties to its right. All the code from above initializes the static |
| 1496 // component of the object literal, and arranges for the map of the result to | 1501 // component of the object literal, and arranges for the map of the result to |
| 1497 // reflect the static order in which the keys appear. For the dynamic | 1502 // reflect the static order in which the keys appear. For the dynamic |
| 1498 // properties, we compile them into a series of "SetOwnProperty" runtime | 1503 // properties, we compile them into a series of "SetOwnProperty" runtime |
| (...skipping 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3870 } | 3875 } |
| 3871 | 3876 |
| 3872 return INTERRUPT; | 3877 return INTERRUPT; |
| 3873 } | 3878 } |
| 3874 | 3879 |
| 3875 | 3880 |
| 3876 } // namespace internal | 3881 } // namespace internal |
| 3877 } // namespace v8 | 3882 } // namespace v8 |
| 3878 | 3883 |
| 3879 #endif // V8_TARGET_ARCH_ARM64 | 3884 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |