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

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

Issue 2207413002: [turbofan] Fix missing bailout for accessors in literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_X64 5 #if V8_TARGET_ARCH_X64
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 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1411 case ObjectLiteral::Property::PROTOTYPE: 1411 case ObjectLiteral::Property::PROTOTYPE:
1412 PushOperand(Operand(rsp, 0)); // Duplicate receiver. 1412 PushOperand(Operand(rsp, 0)); // Duplicate receiver.
1413 VisitForStackValue(value); 1413 VisitForStackValue(value);
1414 DCHECK(property->emit_store()); 1414 DCHECK(property->emit_store());
1415 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); 1415 CallRuntimeWithOperands(Runtime::kInternalSetPrototype);
1416 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), 1416 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1417 BailoutState::NO_REGISTERS); 1417 BailoutState::NO_REGISTERS);
1418 break; 1418 break;
1419 case ObjectLiteral::Property::GETTER: 1419 case ObjectLiteral::Property::GETTER:
1420 if (property->emit_store()) { 1420 if (property->emit_store()) {
1421 accessor_table.lookup(key)->second->getter = property; 1421 AccessorTable::Iterator it = accessor_table.lookup(key);
1422 it->second->bailout_id = expr->GetIdForPropertySet(property_index);
1423 it->second->getter = property;
1422 } 1424 }
1423 break; 1425 break;
1424 case ObjectLiteral::Property::SETTER: 1426 case ObjectLiteral::Property::SETTER:
1425 if (property->emit_store()) { 1427 if (property->emit_store()) {
1426 accessor_table.lookup(key)->second->setter = property; 1428 AccessorTable::Iterator it = accessor_table.lookup(key);
1429 it->second->bailout_id = expr->GetIdForPropertySet(property_index);
1430 it->second->setter = property;
1427 } 1431 }
1428 break; 1432 break;
1429 } 1433 }
1430 } 1434 }
1431 1435
1432 // Emit code to define accessors, using only a single call to the runtime for 1436 // Emit code to define accessors, using only a single call to the runtime for
1433 // each pair of corresponding getters and setters. 1437 // each pair of corresponding getters and setters.
1434 for (AccessorTable::Iterator it = accessor_table.begin(); 1438 for (AccessorTable::Iterator it = accessor_table.begin();
1435 it != accessor_table.end(); 1439 it != accessor_table.end();
1436 ++it) { 1440 ++it) {
1437 PushOperand(Operand(rsp, 0)); // Duplicate receiver. 1441 PushOperand(Operand(rsp, 0)); // Duplicate receiver.
1438 VisitForStackValue(it->first); 1442 VisitForStackValue(it->first);
1439 EmitAccessor(it->second->getter); 1443 EmitAccessor(it->second->getter);
1440 EmitAccessor(it->second->setter); 1444 EmitAccessor(it->second->setter);
1441 PushOperand(Smi::FromInt(NONE)); 1445 PushOperand(Smi::FromInt(NONE));
1442 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); 1446 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked);
1447 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS);
1443 } 1448 }
1444 1449
1445 // Object literals have two parts. The "static" part on the left contains no 1450 // Object literals have two parts. The "static" part on the left contains no
1446 // computed property names, and so we can compute its map ahead of time; see 1451 // computed property names, and so we can compute its map ahead of time; see
1447 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part 1452 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part
1448 // starts with the first computed property name, and continues with all 1453 // starts with the first computed property name, and continues with all
1449 // properties to its right. All the code from above initializes the static 1454 // properties to its right. All the code from above initializes the static
1450 // component of the object literal, and arranges for the map of the result to 1455 // component of the object literal, and arranges for the map of the result to
1451 // reflect the static order in which the keys appear. For the dynamic 1456 // reflect the static order in which the keys appear. For the dynamic
1452 // properties, we compile them into a series of "SetOwnProperty" runtime 1457 // properties, we compile them into a series of "SetOwnProperty" runtime
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after
3658 DCHECK_EQ( 3663 DCHECK_EQ(
3659 isolate->builtins()->OnStackReplacement()->entry(), 3664 isolate->builtins()->OnStackReplacement()->entry(),
3660 Assembler::target_address_at(call_target_address, unoptimized_code)); 3665 Assembler::target_address_at(call_target_address, unoptimized_code));
3661 return ON_STACK_REPLACEMENT; 3666 return ON_STACK_REPLACEMENT;
3662 } 3667 }
3663 3668
3664 } // namespace internal 3669 } // namespace internal
3665 } // namespace v8 3670 } // namespace v8
3666 3671
3667 #endif // V8_TARGET_ARCH_X64 3672 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698