Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.cc

Issue 2230983005: Merged: [turbofan] Fix missing bailout for accessors in literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.3
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_IA32 5 #if V8_TARGET_ARCH_IA32
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 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 case ObjectLiteral::Property::PROTOTYPE: 1391 case ObjectLiteral::Property::PROTOTYPE:
1392 PushOperand(Operand(esp, 0)); // Duplicate receiver. 1392 PushOperand(Operand(esp, 0)); // Duplicate receiver.
1393 VisitForStackValue(value); 1393 VisitForStackValue(value);
1394 DCHECK(property->emit_store()); 1394 DCHECK(property->emit_store());
1395 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); 1395 CallRuntimeWithOperands(Runtime::kInternalSetPrototype);
1396 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), 1396 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1397 BailoutState::NO_REGISTERS); 1397 BailoutState::NO_REGISTERS);
1398 break; 1398 break;
1399 case ObjectLiteral::Property::GETTER: 1399 case ObjectLiteral::Property::GETTER:
1400 if (property->emit_store()) { 1400 if (property->emit_store()) {
1401 accessor_table.lookup(key)->second->getter = property; 1401 AccessorTable::Iterator it = accessor_table.lookup(key);
1402 it->second->bailout_id = expr->GetIdForPropertySet(property_index);
1403 it->second->getter = property;
1402 } 1404 }
1403 break; 1405 break;
1404 case ObjectLiteral::Property::SETTER: 1406 case ObjectLiteral::Property::SETTER:
1405 if (property->emit_store()) { 1407 if (property->emit_store()) {
1406 accessor_table.lookup(key)->second->setter = property; 1408 AccessorTable::Iterator it = accessor_table.lookup(key);
1409 it->second->bailout_id = expr->GetIdForPropertySet(property_index);
1410 it->second->setter = property;
1407 } 1411 }
1408 break; 1412 break;
1409 } 1413 }
1410 } 1414 }
1411 1415
1412 // Emit code to define accessors, using only a single call to the runtime for 1416 // Emit code to define accessors, using only a single call to the runtime for
1413 // each pair of corresponding getters and setters. 1417 // each pair of corresponding getters and setters.
1414 for (AccessorTable::Iterator it = accessor_table.begin(); 1418 for (AccessorTable::Iterator it = accessor_table.begin();
1415 it != accessor_table.end(); 1419 it != accessor_table.end();
1416 ++it) { 1420 ++it) {
1417 PushOperand(Operand(esp, 0)); // Duplicate receiver. 1421 PushOperand(Operand(esp, 0)); // Duplicate receiver.
1418 VisitForStackValue(it->first); 1422 VisitForStackValue(it->first);
1419 1423
1420 EmitAccessor(it->second->getter); 1424 EmitAccessor(it->second->getter);
1421 EmitAccessor(it->second->setter); 1425 EmitAccessor(it->second->setter);
1422 1426
1423 PushOperand(Smi::FromInt(NONE)); 1427 PushOperand(Smi::FromInt(NONE));
1424 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); 1428 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked);
1429 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS);
1425 } 1430 }
1426 1431
1427 // Object literals have two parts. The "static" part on the left contains no 1432 // Object literals have two parts. The "static" part on the left contains no
1428 // computed property names, and so we can compute its map ahead of time; see 1433 // computed property names, and so we can compute its map ahead of time; see
1429 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part 1434 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part
1430 // starts with the first computed property name, and continues with all 1435 // starts with the first computed property name, and continues with all
1431 // properties to its right. All the code from above initializes the static 1436 // properties to its right. All the code from above initializes the static
1432 // component of the object literal, and arranges for the map of the result to 1437 // component of the object literal, and arranges for the map of the result to
1433 // reflect the static order in which the keys appear. For the dynamic 1438 // reflect the static order in which the keys appear. For the dynamic
1434 // properties, we compile them into a series of "SetOwnProperty" runtime 1439 // properties, we compile them into a series of "SetOwnProperty" runtime
(...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after
3693 isolate->builtins()->OnStackReplacement()->entry(), 3698 isolate->builtins()->OnStackReplacement()->entry(),
3694 Assembler::target_address_at(call_target_address, unoptimized_code)); 3699 Assembler::target_address_at(call_target_address, unoptimized_code));
3695 return ON_STACK_REPLACEMENT; 3700 return ON_STACK_REPLACEMENT;
3696 } 3701 }
3697 3702
3698 3703
3699 } // namespace internal 3704 } // namespace internal
3700 } // namespace v8 3705 } // namespace v8
3701 3706
3702 #endif // V8_TARGET_ARCH_IA32 3707 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698