Index: src/full-codegen/arm64/full-codegen-arm64.cc |
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc |
index f3228a07955f9d1207972f3fa8c60ab304fa02bf..aafcd674ca30b74b71dd927f89d90458ebbb7090 100644 |
--- a/src/full-codegen/arm64/full-codegen-arm64.cc |
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc |
@@ -179,8 +179,7 @@ |
__ Mov(x10, Operand(info->scope()->GetScopeInfo(info->isolate()))); |
__ Push(x1, x10); |
__ CallRuntime(Runtime::kNewScriptContext); |
- PrepareForBailoutForId(BailoutId::ScriptContext(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(BailoutId::ScriptContext(), TOS_REG); |
// The new target value is not used, clobbering is safe. |
DCHECK_NULL(info->scope()->new_target_var()); |
} else { |
@@ -236,8 +235,7 @@ |
// Register holding this function and new target are both trashed in case we |
// bailout here. But since that can happen only when new target is not used |
// and we allocate a context, the value of |function_in_register| is correct. |
- PrepareForBailoutForId(BailoutId::FunctionContext(), |
- BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(BailoutId::FunctionContext(), NO_REGISTERS); |
// Possibly set up a local binding to the this function which is used in |
// derived constructors with super calls. |
@@ -299,8 +297,7 @@ |
} |
// Visit the declarations and body. |
- PrepareForBailoutForId(BailoutId::FunctionEntry(), |
- BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS); |
{ |
Comment cmnt(masm_, "[ Declarations"); |
VisitDeclarations(scope()->declarations()); |
@@ -313,8 +310,7 @@ |
{ |
Comment cmnt(masm_, "[ Stack check"); |
- PrepareForBailoutForId(BailoutId::Declarations(), |
- BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(BailoutId::Declarations(), NO_REGISTERS); |
Label ok; |
DCHECK(jssp.Is(__ StackPointer())); |
__ CompareRoot(jssp, Heap::kStackLimitRootIndex); |
@@ -397,11 +393,11 @@ |
EmitProfilingCounterReset(); |
__ Bind(&ok); |
- PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
// Record a mapping of the OSR id to this PC. This is used if the OSR |
// entry becomes the target of a bailout. We don't expect it to be, but |
// we want it to work if it is. |
- PrepareForBailoutForId(stmt->OsrEntryId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->OsrEntryId(), NO_REGISTERS); |
} |
void FullCodeGenerator::EmitProfilingCounterHandlingForReturnSequence( |
@@ -732,7 +728,7 @@ |
if (should_normalize) { |
__ B(&skip); |
} |
- PrepareForBailout(expr, BailoutState::TOS_REGISTER); |
+ PrepareForBailout(expr, TOS_REG); |
if (should_normalize) { |
__ CompareRoot(x0, Heap::kTrueValueRootIndex); |
Split(eq, if_true, if_false, NULL); |
@@ -790,7 +786,7 @@ |
__ LoadRoot(x10, Heap::kTheHoleValueRootIndex); |
__ Str(x10, ContextMemOperand(cp, variable->index())); |
// No write barrier since the_hole_value is in old space. |
- PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
} |
break; |
@@ -812,7 +808,7 @@ |
} |
__ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
__ CallRuntime(Runtime::kDeclareLookupSlot); |
- PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
break; |
} |
} |
@@ -858,7 +854,7 @@ |
kDontSaveFPRegs, |
EMIT_REMEMBERED_SET, |
OMIT_SMI_CHECK); |
- PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
break; |
} |
@@ -870,7 +866,7 @@ |
VisitForStackValue(declaration->fun()); |
PushOperand(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
CallRuntimeWithOperands(Runtime::kDeclareLookupSlot); |
- PrepareForBailoutForId(proxy->id(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
break; |
} |
} |
@@ -907,7 +903,7 @@ |
// Keep the switch value on the stack until a case matches. |
VisitForStackValue(stmt->tag()); |
- PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
ZoneList<CaseClause*>* clauses = stmt->cases(); |
CaseClause* default_clause = NULL; // Can occur anywhere in the list. |
@@ -954,7 +950,7 @@ |
Label skip; |
__ B(&skip); |
- PrepareForBailout(clause, BailoutState::TOS_REGISTER); |
+ PrepareForBailout(clause, TOS_REG); |
__ JumpIfNotRoot(x0, Heap::kTrueValueRootIndex, &next_test); |
__ Drop(1); |
__ B(clause->body_target()); |
@@ -980,12 +976,12 @@ |
Comment cmnt(masm_, "[ Case body"); |
CaseClause* clause = clauses->at(i); |
__ Bind(clause->body_target()); |
- PrepareForBailoutForId(clause->EntryId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(clause->EntryId(), NO_REGISTERS); |
VisitStatements(clause->statements()); |
} |
__ Bind(nested_statement.break_label()); |
- PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
} |
@@ -1018,7 +1014,7 @@ |
ToObjectStub stub(isolate()); |
__ CallStub(&stub); |
__ Bind(&done_convert); |
- PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
__ Push(x0); |
// Check cache validity in generated code. If we cannot guarantee cache |
@@ -1038,7 +1034,7 @@ |
__ Bind(&call_runtime); |
__ Push(x0); // Duplicate the enumerable object on the stack. |
__ CallRuntime(Runtime::kForInEnumerate); |
- PrepareForBailoutForId(stmt->EnumId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(stmt->EnumId(), TOS_REG); |
// If we got a map from the runtime call, we can do a fast |
// modification check. Otherwise, we got a fixed array, and we have |
@@ -1074,7 +1070,7 @@ |
__ Mov(x1, Smi::FromInt(1)); // Smi(1) indicates slow check. |
__ Ldr(x2, FieldMemOperand(x0, FixedArray::kLengthOffset)); |
__ Push(x1, x0, x2); // Smi and array, fixed array length (as smi). |
- PrepareForBailoutForId(stmt->PrepareId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->PrepareId(), NO_REGISTERS); |
__ Push(xzr); // Initial index. |
// Generate code for doing the condition check. |
@@ -1114,7 +1110,7 @@ |
// just skip it. |
__ Push(x1, x3); |
__ CallRuntime(Runtime::kForInFilter); |
- PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(stmt->FilterId(), TOS_REG); |
__ Mov(x3, x0); |
__ JumpIfRoot(x0, Heap::kUndefinedValueRootIndex, |
loop_statement.continue_label()); |
@@ -1126,11 +1122,11 @@ |
// Perform the assignment as if via '='. |
{ EffectContext context(this); |
EmitAssignment(stmt->each(), stmt->EachFeedbackSlot()); |
- PrepareForBailoutForId(stmt->AssignmentId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->AssignmentId(), NO_REGISTERS); |
} |
// Both Crankshaft and Turbofan expect BodyId to be right before stmt->body(). |
- PrepareForBailoutForId(stmt->BodyId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
// Generate code for the body of the loop. |
Visit(stmt->body()); |
@@ -1150,7 +1146,7 @@ |
DropOperands(5); |
// Exit and decrement the loop depth. |
- PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
__ Bind(&exit); |
decrement_loop_depth(); |
} |
@@ -1303,7 +1299,7 @@ |
TypeofMode typeof_mode) { |
// Record position before possible IC call. |
SetExpressionPosition(proxy); |
- PrepareForBailoutForId(proxy->BeforeId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); |
Variable* var = proxy->var(); |
// Three cases: global variables, lookup variables, and all other types of |
@@ -1411,7 +1407,7 @@ |
__ CallStub(&stub); |
RestoreContext(); |
} |
- PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
// If result_saved is true the result is on top of the stack. If |
// result_saved is false the result is in x0. |
@@ -1447,7 +1443,7 @@ |
__ Peek(StoreDescriptor::ReceiverRegister(), 0); |
EmitLoadStoreICSlot(property->GetSlot(0)); |
CallStoreIC(); |
- PrepareForBailoutForId(key->id(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(key->id(), NO_REGISTERS); |
if (NeedsHomeObject(value)) { |
EmitSetHomeObjectAccumulator(value, 0, property->GetSlot(1)); |
@@ -1480,7 +1476,7 @@ |
VisitForStackValue(value); |
CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
- BailoutState::NO_REGISTERS); |
+ NO_REGISTERS); |
break; |
case ObjectLiteral::Property::GETTER: |
if (property->emit_store()) { |
@@ -1537,7 +1533,7 @@ |
DCHECK(property->emit_store()); |
CallRuntimeWithOperands(Runtime::kInternalSetPrototype); |
PrepareForBailoutForId(expr->GetIdForPropertySet(property_index), |
- BailoutState::NO_REGISTERS); |
+ NO_REGISTERS); |
} else { |
EmitPropertyKey(property, expr->GetIdForPropertyName(property_index)); |
VisitForStackValue(value); |
@@ -1608,7 +1604,7 @@ |
FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); |
__ CallStub(&stub); |
} |
- PrepareForBailoutForId(expr->CreateLiteralId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->CreateLiteralId(), TOS_REG); |
bool result_saved = false; // Is the result saved to the stack? |
ZoneList<Expression*>* subexprs = expr->values(); |
@@ -1638,8 +1634,7 @@ |
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
CallIC(ic); |
- PrepareForBailoutForId(expr->GetIdForElement(array_index), |
- BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
} |
// In case the array literal contains spread expressions it has two parts. The |
@@ -1659,8 +1654,7 @@ |
VisitForStackValue(subexpr); |
CallRuntimeWithOperands(Runtime::kAppendElement); |
- PrepareForBailoutForId(expr->GetIdForElement(array_index), |
- BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->GetIdForElement(array_index), NO_REGISTERS); |
} |
if (result_saved) { |
@@ -1740,27 +1734,23 @@ |
switch (assign_type) { |
case VARIABLE: |
EmitVariableLoad(expr->target()->AsVariableProxy()); |
- PrepareForBailout(expr->target(), BailoutState::TOS_REGISTER); |
+ PrepareForBailout(expr->target(), TOS_REG); |
break; |
case NAMED_PROPERTY: |
EmitNamedPropertyLoad(property); |
- PrepareForBailoutForId(property->LoadId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(property->LoadId(), TOS_REG); |
break; |
case NAMED_SUPER_PROPERTY: |
EmitNamedSuperPropertyLoad(property); |
- PrepareForBailoutForId(property->LoadId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(property->LoadId(), TOS_REG); |
break; |
case KEYED_SUPER_PROPERTY: |
EmitKeyedSuperPropertyLoad(property); |
- PrepareForBailoutForId(property->LoadId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(property->LoadId(), TOS_REG); |
break; |
case KEYED_PROPERTY: |
EmitKeyedPropertyLoad(property); |
- PrepareForBailoutForId(property->LoadId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(property->LoadId(), TOS_REG); |
break; |
} |
} |
@@ -1780,7 +1770,7 @@ |
} |
// Deoptimization point in case the binary operation may have side effects. |
- PrepareForBailout(expr->binary_operation(), BailoutState::TOS_REGISTER); |
+ PrepareForBailout(expr->binary_operation(), TOS_REG); |
} else { |
VisitForAccumulatorValue(expr->value()); |
} |
@@ -1792,7 +1782,7 @@ |
case VARIABLE: |
EmitVariableAssignment(expr->target()->AsVariableProxy()->var(), |
expr->op(), expr->AssignmentSlot()); |
- PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
context()->Plug(x0); |
break; |
case NAMED_PROPERTY: |
@@ -2172,7 +2162,7 @@ |
EmitLoadStoreICSlot(expr->AssignmentSlot()); |
CallStoreIC(); |
- PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
context()->Plug(x0); |
} |
@@ -2220,7 +2210,7 @@ |
EmitLoadStoreICSlot(expr->AssignmentSlot()); |
CallIC(ic); |
- PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
context()->Plug(x0); |
} |
@@ -2244,7 +2234,7 @@ |
if (callee->IsVariableProxy()) { |
{ StackValueContext context(this); |
EmitVariableLoad(callee->AsVariableProxy()); |
- PrepareForBailout(callee, BailoutState::NO_REGISTERS); |
+ PrepareForBailout(callee, NO_REGISTERS); |
} |
// Push undefined as receiver. This is patched in the method prologue if it |
// is a sloppy mode method. |
@@ -2261,8 +2251,7 @@ |
DCHECK(!callee->AsProperty()->IsSuperAccess()); |
__ Peek(LoadDescriptor::ReceiverRegister(), 0); |
EmitNamedPropertyLoad(callee->AsProperty()); |
- PrepareForBailoutForId(callee->AsProperty()->LoadId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); |
// Push the target function under the receiver. |
PopOperand(x10); |
PushOperands(x0, x10); |
@@ -2302,7 +2291,7 @@ |
// - home_object |
// - key |
CallRuntimeWithOperands(Runtime::kLoadFromSuper); |
- PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(prop->LoadId(), TOS_REG); |
// Replace home_object with target function. |
__ Poke(x0, kPointerSize); |
@@ -2328,8 +2317,7 @@ |
__ Peek(LoadDescriptor::ReceiverRegister(), 0); |
__ Move(LoadDescriptor::NameRegister(), x0); |
EmitKeyedPropertyLoad(callee->AsProperty()); |
- PrepareForBailoutForId(callee->AsProperty()->LoadId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); |
// Push the target function under the receiver. |
PopOperand(x10); |
@@ -2365,7 +2353,7 @@ |
// - home_object |
// - key |
CallRuntimeWithOperands(Runtime::kLoadKeyedFromSuper); |
- PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(prop->LoadId(), TOS_REG); |
// Replace home_object with target function. |
__ Poke(x0, kPointerSize); |
@@ -2386,7 +2374,7 @@ |
VisitForStackValue(args->at(i)); |
} |
- PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
SetCallPosition(expr, expr->tail_call_mode()); |
if (expr->tail_call_mode() == TailCallMode::kAllow) { |
if (FLAG_trace) { |
@@ -2455,7 +2443,7 @@ |
__ Push(callee->name()); |
__ CallRuntime(Runtime::kLoadLookupSlotForCall); |
PushOperands(x0, x1); // Receiver, function. |
- PrepareForBailoutForId(expr->LookupId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS); |
// If fast case code has been generated, emit code to push the |
// function and receiver and have the slow path jump around this |
@@ -2504,7 +2492,7 @@ |
// Touch up the stack with the resolved function. |
__ Poke(x0, (arg_count + 1) * kPointerSize); |
- PrepareForBailoutForId(expr->EvalId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->EvalId(), NO_REGISTERS); |
// Record source position for debugger. |
SetCallPosition(expr); |
@@ -2556,7 +2544,7 @@ |
CallConstructStub stub(isolate()); |
__ Call(stub.GetCode(), RelocInfo::CODE_TARGET); |
OperandStackDepthDecrement(arg_count + 1); |
- PrepareForBailoutForId(expr->ReturnId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->ReturnId(), TOS_REG); |
RestoreContext(); |
context()->Plug(x0); |
} |
@@ -2989,7 +2977,7 @@ |
for (Expression* const arg : *args) { |
VisitForStackValue(arg); |
} |
- PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
// Move target to x1. |
int const argc = args->length() - 2; |
__ Peek(x1, (argc + 1) * kXRegSize); |
@@ -3208,14 +3196,12 @@ |
if (!context()->IsAccumulatorValue()) OperandStackDepthIncrement(1); |
__ Bind(&materialize_true); |
- PrepareForBailoutForId(expr->MaterializeTrueId(), |
- BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->MaterializeTrueId(), NO_REGISTERS); |
__ LoadRoot(result_register(), Heap::kTrueValueRootIndex); |
__ B(&done); |
__ Bind(&materialize_false); |
- PrepareForBailoutForId(expr->MaterializeFalseId(), |
- BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->MaterializeFalseId(), NO_REGISTERS); |
__ LoadRoot(result_register(), Heap::kFalseValueRootIndex); |
__ B(&done); |
@@ -3315,9 +3301,9 @@ |
// We need a second deoptimization point after loading the value |
// in case evaluating the property load my have a side effect. |
if (assign_type == VARIABLE) { |
- PrepareForBailout(expr->expression(), BailoutState::TOS_REGISTER); |
+ PrepareForBailout(expr->expression(), TOS_REG); |
} else { |
- PrepareForBailoutForId(prop->LoadId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(prop->LoadId(), TOS_REG); |
} |
// Inline smi case if we are in a loop. |
@@ -3366,7 +3352,7 @@ |
// Convert old value into a number. |
ToNumberStub convert_stub(isolate()); |
__ CallStub(&convert_stub); |
- PrepareForBailoutForId(expr->ToNumberId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
// Save result for postfix expressions. |
if (expr->is_postfix()) { |
@@ -3415,8 +3401,7 @@ |
{ EffectContext context(this); |
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
Token::ASSIGN, expr->CountSlot()); |
- PrepareForBailoutForId(expr->AssignmentId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
context.Plug(x0); |
} |
// For all contexts except EffectConstant We have the result on |
@@ -3427,8 +3412,7 @@ |
} else { |
EmitVariableAssignment(expr->expression()->AsVariableProxy()->var(), |
Token::ASSIGN, expr->CountSlot()); |
- PrepareForBailoutForId(expr->AssignmentId(), |
- BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
context()->Plug(x0); |
} |
break; |
@@ -3438,7 +3422,7 @@ |
PopOperand(StoreDescriptor::ReceiverRegister()); |
EmitLoadStoreICSlot(expr->CountSlot()); |
CallStoreIC(); |
- PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
if (expr->is_postfix()) { |
if (!context()->IsEffect()) { |
context()->PlugTOS(); |
@@ -3477,7 +3461,7 @@ |
CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
EmitLoadStoreICSlot(expr->CountSlot()); |
CallIC(ic); |
- PrepareForBailoutForId(expr->AssignmentId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->AssignmentId(), TOS_REG); |
if (expr->is_postfix()) { |
if (!context()->IsEffect()) { |
context()->PlugTOS(); |