| 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_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 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 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 case ObjectLiteral::Property::PROTOTYPE: | 1383 case ObjectLiteral::Property::PROTOTYPE: |
| 1384 PushOperand(Operand(esp, 0)); // Duplicate receiver. | 1384 PushOperand(Operand(esp, 0)); // Duplicate receiver. |
| 1385 VisitForStackValue(value); | 1385 VisitForStackValue(value); |
| 1386 DCHECK(property->emit_store()); | 1386 DCHECK(property->emit_store()); |
| 1387 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); | 1387 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
| 1388 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), | 1388 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
| 1389 BailoutState::NO_REGISTERS); | 1389 BailoutState::NO_REGISTERS); |
| 1390 break; | 1390 break; |
| 1391 case ObjectLiteral::Property::GETTER: | 1391 case ObjectLiteral::Property::GETTER: |
| 1392 if (property->emit_store()) { | 1392 if (property->emit_store()) { |
| 1393 accessor_table.lookup(key)->second->getter = property; | 1393 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1394 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1395 it->second->getter = property; |
| 1394 } | 1396 } |
| 1395 break; | 1397 break; |
| 1396 case ObjectLiteral::Property::SETTER: | 1398 case ObjectLiteral::Property::SETTER: |
| 1397 if (property->emit_store()) { | 1399 if (property->emit_store()) { |
| 1398 accessor_table.lookup(key)->second->setter = property; | 1400 AccessorTable::Iterator it = accessor_table.lookup(key); |
| 1401 it->second->bailout_id = expr->GetIdForPropertySet(property_index); |
| 1402 it->second->setter = property; |
| 1399 } | 1403 } |
| 1400 break; | 1404 break; |
| 1401 } | 1405 } |
| 1402 } | 1406 } |
| 1403 | 1407 |
| 1404 // Emit code to define accessors, using only a single call to the runtime for | 1408 // Emit code to define accessors, using only a single call to the runtime for |
| 1405 // each pair of corresponding getters and setters. | 1409 // each pair of corresponding getters and setters. |
| 1406 for (AccessorTable::Iterator it = accessor_table.begin(); | 1410 for (AccessorTable::Iterator it = accessor_table.begin(); |
| 1407 it != accessor_table.end(); | 1411 it != accessor_table.end(); |
| 1408 ++it) { | 1412 ++it) { |
| 1409 PushOperand(Operand(esp, 0)); // Duplicate receiver. | 1413 PushOperand(Operand(esp, 0)); // Duplicate receiver. |
| 1410 VisitForStackValue(it->first); | 1414 VisitForStackValue(it->first); |
| 1411 | 1415 |
| 1412 EmitAccessor(it->second->getter); | 1416 EmitAccessor(it->second->getter); |
| 1413 EmitAccessor(it->second->setter); | 1417 EmitAccessor(it->second->setter); |
| 1414 | 1418 |
| 1415 PushOperand(Smi::FromInt(NONE)); | 1419 PushOperand(Smi::FromInt(NONE)); |
| 1416 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); | 1420 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); |
| 1421 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS); |
| 1417 } | 1422 } |
| 1418 | 1423 |
| 1419 // Object literals have two parts. The "static" part on the left contains no | 1424 // Object literals have two parts. The "static" part on the left contains no |
| 1420 // computed property names, and so we can compute its map ahead of time; see | 1425 // computed property names, and so we can compute its map ahead of time; see |
| 1421 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part | 1426 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part |
| 1422 // starts with the first computed property name, and continues with all | 1427 // starts with the first computed property name, and continues with all |
| 1423 // properties to its right. All the code from above initializes the static | 1428 // properties to its right. All the code from above initializes the static |
| 1424 // component of the object literal, and arranges for the map of the result to | 1429 // component of the object literal, and arranges for the map of the result to |
| 1425 // reflect the static order in which the keys appear. For the dynamic | 1430 // reflect the static order in which the keys appear. For the dynamic |
| 1426 // properties, we compile them into a series of "SetOwnProperty" runtime | 1431 // properties, we compile them into a series of "SetOwnProperty" runtime |
| (...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3685 isolate->builtins()->OnStackReplacement()->entry(), | 3690 isolate->builtins()->OnStackReplacement()->entry(), |
| 3686 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3691 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3687 return ON_STACK_REPLACEMENT; | 3692 return ON_STACK_REPLACEMENT; |
| 3688 } | 3693 } |
| 3689 | 3694 |
| 3690 | 3695 |
| 3691 } // namespace internal | 3696 } // namespace internal |
| 3692 } // namespace v8 | 3697 } // namespace v8 |
| 3693 | 3698 |
| 3694 #endif // V8_TARGET_ARCH_X87 | 3699 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |