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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1458 __ lw(a0, MemOperand(sp)); 1458 __ lw(a0, MemOperand(sp));
1459 PushOperand(a0); 1459 PushOperand(a0);
1460 VisitForStackValue(value); 1460 VisitForStackValue(value);
1461 DCHECK(property->emit_store()); 1461 DCHECK(property->emit_store());
1462 CallRuntimeWithOperands(Runtime::kInternalSetPrototype); 1462 CallRuntimeWithOperands(Runtime::kInternalSetPrototype);
1463 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), 1463 PrepareForBailoutForId(expr->GetIdForPropertySet(property_index),
1464 BailoutState::NO_REGISTERS); 1464 BailoutState::NO_REGISTERS);
1465 break; 1465 break;
1466 case ObjectLiteral::Property::GETTER: 1466 case ObjectLiteral::Property::GETTER:
1467 if (property->emit_store()) { 1467 if (property->emit_store()) {
1468 accessor_table.lookup(key)->second->getter = property; 1468 AccessorTable::Iterator it = accessor_table.lookup(key);
1469 it->second->bailout_id = expr->GetIdForPropertySet(property_index);
1470 it->second->getter = property;
1469 } 1471 }
1470 break; 1472 break;
1471 case ObjectLiteral::Property::SETTER: 1473 case ObjectLiteral::Property::SETTER:
1472 if (property->emit_store()) { 1474 if (property->emit_store()) {
1473 accessor_table.lookup(key)->second->setter = property; 1475 AccessorTable::Iterator it = accessor_table.lookup(key);
1476 it->second->bailout_id = expr->GetIdForPropertySet(property_index);
1477 it->second->setter = property;
1474 } 1478 }
1475 break; 1479 break;
1476 } 1480 }
1477 } 1481 }
1478 1482
1479 // Emit code to define accessors, using only a single call to the runtime for 1483 // Emit code to define accessors, using only a single call to the runtime for
1480 // each pair of corresponding getters and setters. 1484 // each pair of corresponding getters and setters.
1481 for (AccessorTable::Iterator it = accessor_table.begin(); 1485 for (AccessorTable::Iterator it = accessor_table.begin();
1482 it != accessor_table.end(); 1486 it != accessor_table.end();
1483 ++it) { 1487 ++it) {
1484 __ lw(a0, MemOperand(sp)); // Duplicate receiver. 1488 __ lw(a0, MemOperand(sp)); // Duplicate receiver.
1485 PushOperand(a0); 1489 PushOperand(a0);
1486 VisitForStackValue(it->first); 1490 VisitForStackValue(it->first);
1487 EmitAccessor(it->second->getter); 1491 EmitAccessor(it->second->getter);
1488 EmitAccessor(it->second->setter); 1492 EmitAccessor(it->second->setter);
1489 __ li(a0, Operand(Smi::FromInt(NONE))); 1493 __ li(a0, Operand(Smi::FromInt(NONE)));
1490 PushOperand(a0); 1494 PushOperand(a0);
1491 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked); 1495 CallRuntimeWithOperands(Runtime::kDefineAccessorPropertyUnchecked);
1496 PrepareForBailoutForId(it->second->bailout_id, BailoutState::NO_REGISTERS);
1492 } 1497 }
1493 1498
1494 // Object literals have two parts. The "static" part on the left contains no 1499 // Object literals have two parts. The "static" part on the left contains no
1495 // computed property names, and so we can compute its map ahead of time; see 1500 // computed property names, and so we can compute its map ahead of time; see
1496 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part 1501 // runtime.cc::CreateObjectLiteralBoilerplate. The second "dynamic" part
1497 // starts with the first computed property name, and continues with all 1502 // starts with the first computed property name, and continues with all
1498 // properties to its right. All the code from above initializes the static 1503 // properties to its right. All the code from above initializes the static
1499 // component of the object literal, and arranges for the map of the result to 1504 // component of the object literal, and arranges for the map of the result to
1500 // reflect the static order in which the keys appear. For the dynamic 1505 // reflect the static order in which the keys appear. For the dynamic
1501 // properties, we compile them into a series of "SetOwnProperty" runtime 1506 // properties, we compile them into a series of "SetOwnProperty" runtime
(...skipping 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after
3780 reinterpret_cast<uint32_t>( 3785 reinterpret_cast<uint32_t>(
3781 isolate->builtins()->OnStackReplacement()->entry())); 3786 isolate->builtins()->OnStackReplacement()->entry()));
3782 return ON_STACK_REPLACEMENT; 3787 return ON_STACK_REPLACEMENT;
3783 } 3788 }
3784 3789
3785 3790
3786 } // namespace internal 3791 } // namespace internal
3787 } // namespace v8 3792 } // namespace v8
3788 3793
3789 #endif // V8_TARGET_ARCH_MIPS 3794 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698