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