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 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 __ LoadP(r3, MemOperand(sp)); | 1426 __ LoadP(r3, MemOperand(sp)); |
1427 PushOperand(r3); | 1427 PushOperand(r3); |
1428 VisitForStackValue(value); | 1428 VisitForStackValue(value); |
1429 DCHECK(property->emit_store()); | 1429 DCHECK(property->emit_store()); |
1430 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1430 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
1431 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1431 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
1432 BailoutState::NO_REGISTERS); | 1432 BailoutState::NO_REGISTERS); |
1433 break; | 1433 break; |
1434 case ObjectLiteral::Property::GETTER: | 1434 case ObjectLiteral::Property::GETTER: |
1435 if (property->emit_store()) { | 1435 if (property->emit_store()) { |
1436 accessor_table.lookup(key)->second->getter = property; | 1436 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1437 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1438 it->second->getter = property; |
1437 } | 1439 } |
1438 break; | 1440 break; |
1439 case ObjectLiteral::Property::SETTER: | 1441 case ObjectLiteral::Property::SETTER: |
1440 if (property->emit_store()) { | 1442 if (property->emit_store()) { |
1441 accessor_table.lookup(key)->second->setter = property; | 1443 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1444 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1445 it->second->setter = property; |
1442 } | 1446 } |
1443 break; | 1447 break; |
1444 } | 1448 } |
1445 } | 1449 } |
1446 | 1450 |
1447 // Emit code to define accessors, using only a single call to the runtime for | 1451 // Emit code to define accessors, using only a single call to the runtime for |
1448 // each pair of corresponding getters and setters. | 1452 // each pair of corresponding getters and setters. |
1449 for (AccessorTable::Iterator it = accessor_table.begin(); | 1453 for (AccessorTable::Iterator it = accessor_table.begin(); |
1450 it != accessor_table.end(); ++it) { | 1454 it != accessor_table.end(); ++it) { |
1451 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. | 1455 __ LoadP(r3, MemOperand(sp)); // Duplicate receiver. |
1452 PushOperand(r3); | 1456 PushOperand(r3); |
1453 VisitForStackValue(it->first); | 1457 VisitForStackValue(it->first); |
1454 EmitAccessor(it->second->getter); | 1458 EmitAccessor(it->second->getter); |
1455 EmitAccessor(it->second->setter); | 1459 EmitAccessor(it->second->setter); |
1456 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); | 1460 __ LoadSmiLiteral(r3, Smi::FromInt(NONE)); |
1457 PushOperand(r3); | 1461 PushOperand(r3); |
1458 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); | 1462 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); |
| 1463 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS); |
1459 } | 1464 } |
1460 | 1465 |
1461 // Object literals have two parts. The "static" part on the left contains no | 1466 // Object literals have two parts. The "static" part on the left contains no |
1462 // computed property names, and so we can compute its map ahead of time; see | 1467 // computed property names, and so we can compute its map ahead of time; see |
1463 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part | 1468 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part |
1464 // starts with the first computed property name, and continues with all | 1469 // starts with the first computed property name, and continues with all |
1465 // properties to its right. All the code from above initializes the static | 1470 // properties to its right. All the code from above initializes the static |
1466 // component of the object literal, and arranges for the map of the result to | 1471 // component of the object literal, and arranges for the map of the result to |
1467 // reflect the static order in which the keys appear. For the dynamic | 1472 // reflect the static order in which the keys appear. For the dynamic |
1468 // properties, we compile them into a series of "SetOwnProperty" runtime | 1473 // properties, we compile them into a series of "SetOwnProperty" runtime |
(...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3761 | 3766 |
3762 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3767 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3763 | 3768 |
3764 DCHECK(interrupt_address == | 3769 DCHECK(interrupt_address == |
3765 isolate->builtins()->OnStackReplacement()->entry()); | 3770 isolate->builtins()->OnStackReplacement()->entry()); |
3766 return ON_STACK_REPLACEMENT; | 3771 return ON_STACK_REPLACEMENT; |
3767 } | 3772 } |
3768 } // namespace internal | 3773 } // namespace internal |
3769 } // namespace v8 | 3774 } // namespace v8 |
3770 #endif // V8_TARGET_ARCH_PPC | 3775 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |