| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1433 __ LoadP(r3, MemOperand(sp)); | 1433 __ LoadP(r3, MemOperand(sp)); |
| 1434 PushOperand(r3); | 1434 PushOperand(r3); |
| 1435 VisitForStackValue(value); | 1435 VisitForStackValue(value); |
| 1436 DCHECK(property->emit_store()); | 1436 DCHECK(property->emit_store()); |
| 1437 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1437 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
| 1438 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1438 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
| 1439 BailoutState::NO_REGISTERS); | 1439 BailoutState::NO_REGISTERS); |
| 1440 break; | 1440 break; |
| 1441 case ObjectLiteral::Property::GETTER: | 1441 case ObjectLiteral::Property::GETTER: |
| 1442 if (property->emit_store()) { | 1442 if (property->emit_store()) { |
| 1443 accessor_table.lookup(key)->second->getter = property; | 1443 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1444 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1445 it->second->getter = property; |
| 1444 } | 1446 } |
| 1445 break; | 1447 break; |
| 1446 case ObjectLiteral::Property::SETTER: | 1448 case ObjectLiteral::Property::SETTER: |
| 1447 if (property->emit_store()) { | 1449 if (property->emit_store()) { |
| 1448 accessor_table.lookup(key)->second->setter = property; | 1450 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1451 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1452 it->second->setter = property; |
| 1449 } | 1453 } |
| 1450 break; | 1454 break; |
| 1451 } | 1455 } |
| 1452 } | 1456 } |
| 1453 | 1457 |
| 1454 // Emit code to define accessors, using only a single call to the runtime for | 1458 // Emit code to define accessors, using only a single call to the runtime for |
| 1455 // each pair of corresponding getters and setters. | 1459 // each pair of corresponding getters and setters. |
| 1456 for (AccessorTable::Iterator it = accessor_table.begin(); | 1460 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1457 it != accessor_table.end(); ++it) { | 1461 it != accessor_table.end(); ++it) { |
| 1458 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. | 1462 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. |
| 1459 PushOperand(r3); | 1463 PushOperand(r3); |
| 1460 VisitForStackValue(it->first); | 1464 VisitForStackValue(it->first); |
| 1461 EmitAccessor(it->second->getter); | 1465 EmitAccessor(it->second->getter); |
| 1462 EmitAccessor(it->second->setter); | 1466 EmitAccessor(it->second->setter); |
| 1463 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); | 1467 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); |
| 1464 PushOperand(r3); | 1468 PushOperand(r3); |
| 1465 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); | 1469 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); |
| 1470 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS); |
| 1466 } | 1471 } |
| 1467 | 1472 |
| 1468 // Object literals have two parts. The "static" part on the left contains no | 1473 // Object literals have two parts. The "static" part on the left contains no |
| 1469 // computed property names, and so we can compute its map ahead of time; see | 1474 // computed property names, and so we can compute its map ahead of time; see |
| 1470 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part | 1475 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part |
| 1471 // starts with the first computed property name, and continues with all | 1476 // starts with the first computed property name, and continues with all |
| 1472 // properties to its right. All the code from above initializes the static | 1477 // properties to its right. All the code from above initializes the static |
| 1473 // component of the object literal, and arranges for the map of the result to | 1478 // component of the object literal, and arranges for the map of the result to |
| 1474 // reflect the static order in which the keys appear. For the dynamic | 1479 // reflect the static order in which the keys appear. For the dynamic |
| 1475 // properties, we compile them into a series of "SetOwnProperty" runtime | 1480 // properties, we compile them into a series of "SetOwnProperty" runtime |
| (...skipping 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3784 | 3789 |
| 3785 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3790 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
| 3786 | 3791 |
| 3787 DCHECK(interrupt_address == | 3792 DCHECK(interrupt_address == |
| 3788 isolate->builtins()->OnStackReplacement()->entry()); | 3793 isolate->builtins()->OnStackReplacement()->entry()); |
| 3789 return ON_STACK_REPLACEMENT; | 3794 return ON_STACK_REPLACEMENT; |
| 3790 } | 3795 } |
| 3791 } // namespace internal | 3796 } // namespace internal |
| 3792 } // namespace v8 | 3797 } // namespace v8 |
| 3793 #endif // V8_TARGET_ARCH_PPC | 3798 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |