Index: src/full-codegen/full-codegen.cc |
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc |
index 6cf3aef7e63f74f713066ee9275e50b7c1c26324..1bd12d511087c9ffad97d1724ea6e154ae0a6174 100644 |
--- a/src/full-codegen/full-codegen.cc |
+++ b/src/full-codegen/full-codegen.cc |
@@ -162,8 +162,8 @@ |
masm_->set_predictable_code_size(true); |
} |
-void FullCodeGenerator::PrepareForBailout(Expression* node, |
- BailoutState state) { |
+ |
+void FullCodeGenerator::PrepareForBailout(Expression* node, State state) { |
PrepareForBailoutForId(node->id(), state); |
} |
@@ -186,9 +186,9 @@ |
// if the function was inlined, i.e., this is the return address in the |
// inlined function's frame. |
// |
- // The bailout state is ignored. We defensively set it to TOS_REGISTER, which |
- // is the real state of the unoptimized code at the return site. |
- PrepareForBailoutForId(call->ReturnId(), BailoutState::TOS_REGISTER); |
+ // The state is ignored. We defensively set it to TOS_REG, which is the |
+ // real state of the unoptimized code at the return site. |
+ PrepareForBailoutForId(call->ReturnId(), TOS_REG); |
#ifdef DEBUG |
// In debug builds, mark the return so we can verify that this function |
// was called. |
@@ -197,13 +197,13 @@ |
#endif |
} |
-void FullCodeGenerator::PrepareForBailoutForId(BailoutId id, |
- BailoutState state) { |
+ |
+void FullCodeGenerator::PrepareForBailoutForId(BailoutId id, State state) { |
// There's no need to prepare this code for bailouts from already optimized |
// code or code that can't be optimized. |
if (!info_->HasDeoptimizationSupport()) return; |
unsigned pc_and_state = |
- BailoutStateField::encode(state) | PcField::encode(masm_->pc_offset()); |
+ StateField::encode(state) | PcField::encode(masm_->pc_offset()); |
DCHECK(Smi::IsValid(pc_and_state)); |
#ifdef DEBUG |
for (int i = 0; i < bailout_entries_.length(); ++i) { |
@@ -750,7 +750,7 @@ |
} else { |
VisitForControl(left, test->true_label(), &eval_right, &eval_right); |
} |
- PrepareForBailoutForId(right_id, BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(right_id, NO_REGISTERS); |
__ bind(&eval_right); |
} else if (context()->IsAccumulatorValue()) { |
@@ -769,7 +769,7 @@ |
__ jmp(&done); |
__ bind(&discard); |
__ Drop(1); |
- PrepareForBailoutForId(right_id, BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(right_id, NO_REGISTERS); |
} else if (context()->IsStackValue()) { |
VisitForAccumulatorValue(left); |
@@ -784,7 +784,7 @@ |
} |
__ bind(&discard); |
__ Drop(1); |
- PrepareForBailoutForId(right_id, BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(right_id, NO_REGISTERS); |
} else { |
DCHECK(context()->IsEffect()); |
@@ -794,7 +794,7 @@ |
} else { |
VisitForControl(left, &done, &eval_right, &eval_right); |
} |
- PrepareForBailoutForId(right_id, BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(right_id, NO_REGISTERS); |
__ bind(&eval_right); |
} |
@@ -852,7 +852,7 @@ |
EmitKeyedSuperPropertyLoad(expr); |
} |
} |
- PrepareForBailoutForId(expr->LoadId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(expr->LoadId(), TOS_REG); |
context()->Plug(result_register()); |
} |
@@ -864,7 +864,7 @@ |
if (proxy != NULL && (proxy->var()->IsUnallocatedOrGlobalSlot() || |
proxy->var()->IsLookupSlot())) { |
EmitVariableLoad(proxy, INSIDE_TYPEOF); |
- PrepareForBailout(proxy, BailoutState::TOS_REGISTER); |
+ PrepareForBailout(proxy, TOS_REG); |
} else { |
// This expression cannot throw a reference error at the top level. |
VisitInDuplicateContext(expr); |
@@ -912,24 +912,24 @@ |
if (stmt->HasElseStatement()) { |
VisitForControl(stmt->condition(), &then_part, &else_part, &then_part); |
- PrepareForBailoutForId(stmt->ThenId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ThenId(), NO_REGISTERS); |
__ bind(&then_part); |
Visit(stmt->then_statement()); |
__ jmp(&done); |
- PrepareForBailoutForId(stmt->ElseId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ElseId(), NO_REGISTERS); |
__ bind(&else_part); |
Visit(stmt->else_statement()); |
} else { |
VisitForControl(stmt->condition(), &then_part, &done, &then_part); |
- PrepareForBailoutForId(stmt->ThenId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ThenId(), NO_REGISTERS); |
__ bind(&then_part); |
Visit(stmt->then_statement()); |
- PrepareForBailoutForId(stmt->ElseId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ElseId(), NO_REGISTERS); |
} |
__ bind(&done); |
- PrepareForBailoutForId(stmt->IfId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->IfId(), NO_REGISTERS); |
} |
void FullCodeGenerator::EmitContinue(Statement* target) { |
@@ -1093,7 +1093,7 @@ |
BailoutId bailout_id) { |
VisitForStackValue(property->key()); |
CallRuntimeWithOperands(Runtime::kToName); |
- PrepareForBailoutForId(bailout_id, BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(bailout_id, NO_REGISTERS); |
PushOperand(result_register()); |
} |
@@ -1119,12 +1119,12 @@ |
Callable callable = CodeFactory::ToObject(isolate()); |
__ Move(callable.descriptor().GetRegisterParameter(0), result_register()); |
__ Call(callable.code(), RelocInfo::CODE_TARGET); |
- PrepareForBailoutForId(stmt->ToObjectId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ToObjectId(), NO_REGISTERS); |
PushOperand(result_register()); |
PushFunctionArgumentForContextAllocation(); |
CallRuntimeWithOperands(Runtime::kPushWithContext); |
StoreToFrameField(StandardFrameConstants::kContextOffset, context_register()); |
- PrepareForBailoutForId(stmt->EntryId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->EntryId(), NO_REGISTERS); |
Scope* saved_scope = scope(); |
scope_ = stmt->scope(); |
@@ -1156,7 +1156,7 @@ |
// Record the position of the do while condition and make sure it is |
// possible to break on the condition. |
__ bind(loop_statement.continue_label()); |
- PrepareForBailoutForId(stmt->ContinueId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ContinueId(), NO_REGISTERS); |
// Here is the actual 'while' keyword. |
SetExpressionAsStatementPosition(stmt->cond()); |
@@ -1166,12 +1166,12 @@ |
&book_keeping); |
// Check stack before looping. |
- PrepareForBailoutForId(stmt->BackEdgeId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->BackEdgeId(), NO_REGISTERS); |
__ bind(&book_keeping); |
EmitBackEdgeBookkeeping(stmt, &body); |
__ jmp(&body); |
- PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
__ bind(loop_statement.break_label()); |
decrement_loop_depth(); |
} |
@@ -1192,7 +1192,7 @@ |
loop_statement.break_label(), |
&body); |
- PrepareForBailoutForId(stmt->BodyId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
__ bind(&body); |
Visit(stmt->body()); |
@@ -1202,7 +1202,7 @@ |
EmitBackEdgeBookkeeping(stmt, &loop); |
__ jmp(&loop); |
- PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
__ bind(loop_statement.break_label()); |
decrement_loop_depth(); |
} |
@@ -1225,11 +1225,11 @@ |
// Emit the test at the bottom of the loop (even if empty). |
__ jmp(&test); |
- PrepareForBailoutForId(stmt->BodyId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->BodyId(), NO_REGISTERS); |
__ bind(&body); |
Visit(stmt->body()); |
- PrepareForBailoutForId(stmt->ContinueId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ContinueId(), NO_REGISTERS); |
__ bind(loop_statement.continue_label()); |
if (stmt->next() != NULL) { |
SetStatementPosition(stmt->next()); |
@@ -1250,7 +1250,7 @@ |
__ jmp(&body); |
} |
- PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
__ bind(loop_statement.break_label()); |
decrement_loop_depth(); |
} |
@@ -1286,12 +1286,12 @@ |
Visit(stmt->body()); |
// Check stack before looping. |
- PrepareForBailoutForId(stmt->BackEdgeId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->BackEdgeId(), NO_REGISTERS); |
EmitBackEdgeBookkeeping(stmt, loop_statement.continue_label()); |
__ jmp(loop_statement.continue_label()); |
// Exit and decrement the loop depth. |
- PrepareForBailoutForId(stmt->ExitId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS); |
__ bind(loop_statement.break_label()); |
decrement_loop_depth(); |
} |
@@ -1435,7 +1435,7 @@ |
__ DebugBreak(); |
// Ignore the return value. |
- PrepareForBailoutForId(stmt->DebugBreakId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(stmt->DebugBreakId(), NO_REGISTERS); |
} |
@@ -1450,7 +1450,7 @@ |
VisitForControl(expr->condition(), &true_case, &false_case, &true_case); |
int original_stack_depth = operand_stack_depth_; |
- PrepareForBailoutForId(expr->ThenId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->ThenId(), NO_REGISTERS); |
__ bind(&true_case); |
SetExpressionPosition(expr->then_expression()); |
if (context()->IsTest()) { |
@@ -1465,7 +1465,7 @@ |
} |
operand_stack_depth_ = original_stack_depth; |
- PrepareForBailoutForId(expr->ElseId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->ElseId(), NO_REGISTERS); |
__ bind(&false_case); |
SetExpressionPosition(expr->else_expression()); |
VisitInDuplicateContext(expr->else_expression()); |
@@ -1516,7 +1516,7 @@ |
PushOperand(Smi::FromInt(lit->end_position())); |
CallRuntimeWithOperands(Runtime::kDefineClass); |
- PrepareForBailoutForId(lit->CreateLiteralId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG); |
PushOperand(result_register()); |
// Load the "prototype" from the constructor. |
@@ -1525,7 +1525,7 @@ |
Heap::kprototype_stringRootIndex); |
__ Move(LoadDescriptor::SlotRegister(), SmiFromSlot(lit->PrototypeSlot())); |
CallLoadIC(NOT_INSIDE_TYPEOF); |
- PrepareForBailoutForId(lit->PrototypeId(), BailoutState::TOS_REGISTER); |
+ PrepareForBailoutForId(lit->PrototypeId(), TOS_REG); |
PushOperand(result_register()); |
EmitClassDefineProperties(lit); |
@@ -1666,7 +1666,7 @@ |
VisitForStackValue(args->at(i)); |
} |
- PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
EmitCallJSRuntimeFunction(expr); |
context()->DropAndPlug(1, result_register()); |
@@ -1688,7 +1688,7 @@ |
} |
// Call the C runtime function. |
- PrepareForBailoutForId(expr->CallId(), BailoutState::NO_REGISTERS); |
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
__ CallRuntime(expr->function(), arg_count); |
OperandStackDepthDecrement(arg_count); |
context()->Plug(result_register()); |
@@ -1877,7 +1877,7 @@ |
saved_scope_ = codegen_->scope(); |
if (scope == NULL) { |
- codegen_->PrepareForBailoutForId(entry_id, BailoutState::NO_REGISTERS); |
+ codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); |
needs_block_context_ = false; |
} else { |
needs_block_context_ = scope->NeedsContext(); |
@@ -1894,13 +1894,12 @@ |
codegen_->context_register()); |
} |
CHECK_EQ(0, scope->num_stack_slots()); |
- codegen_->PrepareForBailoutForId(entry_id, BailoutState::NO_REGISTERS); |
+ codegen_->PrepareForBailoutForId(entry_id, NO_REGISTERS); |
} |
{ |
Comment cmnt(masm(), "[ Declarations"); |
codegen_->VisitDeclarations(scope->declarations()); |
- codegen_->PrepareForBailoutForId(declarations_id, |
- BailoutState::NO_REGISTERS); |
+ codegen_->PrepareForBailoutForId(declarations_id, NO_REGISTERS); |
} |
} |
} |
@@ -1914,7 +1913,7 @@ |
codegen_->StoreToFrameField(StandardFrameConstants::kContextOffset, |
codegen_->context_register()); |
} |
- codegen_->PrepareForBailoutForId(exit_id_, BailoutState::NO_REGISTERS); |
+ codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
codegen_->scope_ = saved_scope_; |
} |