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

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