| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 __ lw(a0, MemOperand(sp)); | 1466 __ lw(a0, MemOperand(sp)); |
| 1467 PushOperand(a0); | 1467 PushOperand(a0); |
| 1468 VisitForStackValue(value); | 1468 VisitForStackValue(value); |
| 1469 DCHECK(property->emit_store()); | 1469 DCHECK(property->emit_store()); |
| 1470 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1470 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
| 1471 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1471 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
| 1472 BailoutState::NO_REGISTERS); | 1472 BailoutState::NO_REGISTERS); |
| 1473 break; | 1473 break; |
| 1474 case ObjectLiteral::Property::GETTER: | 1474 case ObjectLiteral::Property::GETTER: |
| 1475 if (property->emit_store()) { | 1475 if (property->emit_store()) { |
| 1476 accessor_table.lookup(key)->second->getter = property; | 1476 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1477 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1478 it->second->getter = property; |
| 1477 } | 1479 } |
| 1478 break; | 1480 break; |
| 1479 case ObjectLiteral::Property::SETTER: | 1481 case ObjectLiteral::Property::SETTER: |
| 1480 if (property->emit_store()) { | 1482 if (property->emit_store()) { |
| 1481 accessor_table.lookup(key)->second->setter = property; | 1483 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1484 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1485 it->second->setter = property; |
| 1482 } | 1486 } |
| 1483 break; | 1487 break; |
| 1484 } | 1488 } |
| 1485 } | 1489 } |
| 1486 | 1490 |
| 1487 // Emit code to define accessors, using only a single call to the runtime for | 1491 // Emit code to define accessors, using only a single call to the runtime for |
| 1488 // each pair of corresponding getters and setters. | 1492 // each pair of corresponding getters and setters. |
| 1489 for (AccessorTable::Iterator it = accessor_table.begin(); | 1493 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1490 it != accessor_table.end(); | 1494 it != accessor_table.end(); |
| 1491 ++it) { | 1495 ++it) { |
| 1492 __ lw(a0, MemOperand(sp)); // Duplicate receiver. | 1496 __ lw(a0, MemOperand(sp)); // Duplicate receiver. |
| 1493 PushOperand(a0); | 1497 PushOperand(a0); |
| 1494 VisitForStackValue(it->first); | 1498 VisitForStackValue(it->first); |
| 1495 EmitAccessor(it->second->getter); | 1499 EmitAccessor(it->second->getter); |
| 1496 EmitAccessor(it->second->setter); | 1500 EmitAccessor(it->second->setter); |
| 1497 __ li(a0, Operand(Smi::FromInt(NONE))); | 1501 __ li(a0, Operand(Smi::FromInt(NONE))); |
| 1498 PushOperand(a0); | 1502 PushOperand(a0); |
| 1499 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); | 1503 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); |
| 1504 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS); |
| 1500 } | 1505 } |
| 1501 | 1506 |
| 1502 // Object literals have two parts. The "static" part on the left contains no | 1507 // Object literals have two parts. The "static" part on the left contains no |
| 1503 // computed property names, and so we can compute its map ahead of time; see | 1508 // computed property names, and so we can compute its map ahead of time; see |
| 1504 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part | 1509 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part |
| 1505 // starts with the first computed property name, and continues with all | 1510 // starts with the first computed property name, and continues with all |
| 1506 // properties to its right. All the code from above initializes the static | 1511 // properties to its right. All the code from above initializes the static |
| 1507 // component of the object literal, and arranges for the map of the result to | 1512 // component of the object literal, and arranges for the map of the result to |
| 1508 // reflect the static order in which the keys appear. For the dynamic | 1513 // reflect the static order in which the keys appear. For the dynamic |
| 1509 // properties, we compile them into a series of "SetOwnProperty" runtime | 1514 // properties, we compile them into a series of "SetOwnProperty" runtime |
| (...skipping 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3806 reinterpret_cast<uint32_t>( | 3811 reinterpret_cast<uint32_t>( |
| 3807 isolate->builtins()->OnStackReplacement()->entry())); | 3812 isolate->builtins()->OnStackReplacement()->entry())); |
| 3808 return ON_STACK_REPLACEMENT; | 3813 return ON_STACK_REPLACEMENT; |
| 3809 } | 3814 } |
| 3810 | 3815 |
| 3811 | 3816 |
| 3812 } // namespace internal | 3817 } // namespace internal |
| 3813 } // namespace v8 | 3818 } // namespace v8 |
| 3814 | 3819 |
| 3815 #endif // V8_TARGET_ARCH_MIPS | 3820 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |