Commit bc717ae8 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[ast] Remove BailoutId and TypeFeedbackId from AST.

This removes both {BailoutId} as well as {TypeFeedbackId} numbers from
almost all AST nodes. The only exception are {IterationStatement} nodes
which still require an ID for on-stack replacement support.

R=verwaest@chromium.org
BUG=v8:6409

Change-Id: I5f7b7673ae5797b9cbc9741144d304f0d31d4446
Reviewed-on: https://chromium-review.googlesource.com/538792
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45991}
parent f626d5df
...@@ -1513,8 +1513,6 @@ v8_source_set("v8_base") { ...@@ -1513,8 +1513,6 @@ v8_source_set("v8_base") {
"src/crankshaft/lithium-inl.h", "src/crankshaft/lithium-inl.h",
"src/crankshaft/lithium.cc", "src/crankshaft/lithium.cc",
"src/crankshaft/lithium.h", "src/crankshaft/lithium.h",
"src/crankshaft/typing.cc",
"src/crankshaft/typing.h",
"src/crankshaft/unique.h", "src/crankshaft/unique.h",
"src/date.cc", "src/date.cc",
"src/date.h", "src/date.h",
......
...@@ -148,14 +148,12 @@ void AstNumberingVisitor::VisitNativeFunctionLiteral( ...@@ -148,14 +148,12 @@ void AstNumberingVisitor::VisitNativeFunctionLiteral(
NativeFunctionLiteral* node) { NativeFunctionLiteral* node) {
IncrementNodeCount(); IncrementNodeCount();
DisableOptimization(kNativeFunctionLiteral); DisableOptimization(kNativeFunctionLiteral);
node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids()));
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
} }
void AstNumberingVisitor::VisitDoExpression(DoExpression* node) { void AstNumberingVisitor::VisitDoExpression(DoExpression* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(DoExpression::num_ids()));
Visit(node->block()); Visit(node->block());
Visit(node->result()); Visit(node->result());
} }
...@@ -163,13 +161,11 @@ void AstNumberingVisitor::VisitDoExpression(DoExpression* node) { ...@@ -163,13 +161,11 @@ void AstNumberingVisitor::VisitDoExpression(DoExpression* node) {
void AstNumberingVisitor::VisitLiteral(Literal* node) { void AstNumberingVisitor::VisitLiteral(Literal* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(Literal::num_ids()));
} }
void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids()));
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
} }
...@@ -187,7 +183,6 @@ void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) { ...@@ -187,7 +183,6 @@ void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) {
default: default:
break; break;
} }
node->set_base_id(ReserveIdRange(VariableProxy::num_ids()));
} }
void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node, void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node,
...@@ -203,7 +198,6 @@ void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { ...@@ -203,7 +198,6 @@ void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) {
void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) { void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(ThisFunction::num_ids()));
} }
...@@ -211,7 +205,6 @@ void AstNumberingVisitor::VisitSuperPropertyReference( ...@@ -211,7 +205,6 @@ void AstNumberingVisitor::VisitSuperPropertyReference(
SuperPropertyReference* node) { SuperPropertyReference* node) {
IncrementNodeCount(); IncrementNodeCount();
DisableFullCodegenAndCrankshaft(kSuperReference); DisableFullCodegenAndCrankshaft(kSuperReference);
node->set_base_id(ReserveIdRange(SuperPropertyReference::num_ids()));
Visit(node->this_var()); Visit(node->this_var());
Visit(node->home_object()); Visit(node->home_object());
} }
...@@ -220,7 +213,6 @@ void AstNumberingVisitor::VisitSuperPropertyReference( ...@@ -220,7 +213,6 @@ void AstNumberingVisitor::VisitSuperPropertyReference(
void AstNumberingVisitor::VisitSuperCallReference(SuperCallReference* node) { void AstNumberingVisitor::VisitSuperCallReference(SuperCallReference* node) {
IncrementNodeCount(); IncrementNodeCount();
DisableFullCodegenAndCrankshaft(kSuperReference); DisableFullCodegenAndCrankshaft(kSuperReference);
node->set_base_id(ReserveIdRange(SuperCallReference::num_ids()));
Visit(node->this_var()); Visit(node->this_var());
Visit(node->new_target_var()); Visit(node->new_target_var());
Visit(node->this_function_var()); Visit(node->this_function_var());
...@@ -245,21 +237,18 @@ void AstNumberingVisitor::VisitSuspend(Suspend* node) { ...@@ -245,21 +237,18 @@ void AstNumberingVisitor::VisitSuspend(Suspend* node) {
node->set_suspend_id(suspend_count_); node->set_suspend_id(suspend_count_);
suspend_count_++; suspend_count_++;
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(Suspend::num_ids()));
Visit(node->expression()); Visit(node->expression());
} }
void AstNumberingVisitor::VisitThrow(Throw* node) { void AstNumberingVisitor::VisitThrow(Throw* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(Throw::num_ids()));
Visit(node->exception()); Visit(node->exception());
} }
void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) { void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(UnaryOperation::num_ids()));
if ((node->op() == Token::TYPEOF) && node->expression()->IsVariableProxy()) { if ((node->op() == Token::TYPEOF) && node->expression()->IsVariableProxy()) {
VariableProxy* proxy = node->expression()->AsVariableProxy(); VariableProxy* proxy = node->expression()->AsVariableProxy();
VisitVariableProxy(proxy, INSIDE_TYPEOF); VisitVariableProxy(proxy, INSIDE_TYPEOF);
...@@ -271,7 +260,6 @@ void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) { ...@@ -271,7 +260,6 @@ void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) {
void AstNumberingVisitor::VisitCountOperation(CountOperation* node) { void AstNumberingVisitor::VisitCountOperation(CountOperation* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(CountOperation::num_ids()));
Visit(node->expression()); Visit(node->expression());
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
} }
...@@ -279,7 +267,6 @@ void AstNumberingVisitor::VisitCountOperation(CountOperation* node) { ...@@ -279,7 +267,6 @@ void AstNumberingVisitor::VisitCountOperation(CountOperation* node) {
void AstNumberingVisitor::VisitBlock(Block* node) { void AstNumberingVisitor::VisitBlock(Block* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(Block::num_ids()));
Scope* scope = node->scope(); Scope* scope = node->scope();
if (scope != nullptr) { if (scope != nullptr) {
LanguageModeScope language_mode_scope(this, scope->language_mode()); LanguageModeScope language_mode_scope(this, scope->language_mode());
...@@ -305,7 +292,6 @@ void AstNumberingVisitor::VisitFunctionDeclaration(FunctionDeclaration* node) { ...@@ -305,7 +292,6 @@ void AstNumberingVisitor::VisitFunctionDeclaration(FunctionDeclaration* node) {
void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) { void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(CallRuntime::num_ids()));
VisitArguments(node->arguments()); VisitArguments(node->arguments());
// To support catch prediction within async/await: // To support catch prediction within async/await:
// //
...@@ -401,7 +387,6 @@ void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) { ...@@ -401,7 +387,6 @@ void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) {
void AstNumberingVisitor::VisitPropertyReference(Property* node) { void AstNumberingVisitor::VisitPropertyReference(Property* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(Property::num_ids()));
Visit(node->key()); Visit(node->key());
Visit(node->obj()); Visit(node->obj());
} }
...@@ -425,7 +410,6 @@ void AstNumberingVisitor::VisitProperty(Property* node) { ...@@ -425,7 +410,6 @@ void AstNumberingVisitor::VisitProperty(Property* node) {
void AstNumberingVisitor::VisitAssignment(Assignment* node) { void AstNumberingVisitor::VisitAssignment(Assignment* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(Assignment::num_ids()));
if (node->is_compound()) VisitBinaryOperation(node->binary_operation()); if (node->is_compound()) VisitBinaryOperation(node->binary_operation());
VisitReference(node->target()); VisitReference(node->target());
...@@ -436,7 +420,6 @@ void AstNumberingVisitor::VisitAssignment(Assignment* node) { ...@@ -436,7 +420,6 @@ void AstNumberingVisitor::VisitAssignment(Assignment* node) {
void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) { void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(BinaryOperation::num_ids()));
Visit(node->left()); Visit(node->left());
Visit(node->right()); Visit(node->right());
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
...@@ -445,7 +428,6 @@ void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) { ...@@ -445,7 +428,6 @@ void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) {
void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(CompareOperation::num_ids()));
Visit(node->left()); Visit(node->left());
Visit(node->right()); Visit(node->right());
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
...@@ -455,7 +437,6 @@ void AstNumberingVisitor::VisitSpread(Spread* node) { ...@@ -455,7 +437,6 @@ void AstNumberingVisitor::VisitSpread(Spread* node) {
IncrementNodeCount(); IncrementNodeCount();
// We can only get here from spread calls currently. // We can only get here from spread calls currently.
DisableFullCodegenAndCrankshaft(kSpreadCall); DisableFullCodegenAndCrankshaft(kSpreadCall);
node->set_base_id(ReserveIdRange(Spread::num_ids()));
Visit(node->expression()); Visit(node->expression());
} }
...@@ -466,7 +447,6 @@ void AstNumberingVisitor::VisitEmptyParentheses(EmptyParentheses* node) { ...@@ -466,7 +447,6 @@ void AstNumberingVisitor::VisitEmptyParentheses(EmptyParentheses* node) {
void AstNumberingVisitor::VisitGetIterator(GetIterator* node) { void AstNumberingVisitor::VisitGetIterator(GetIterator* node) {
IncrementNodeCount(); IncrementNodeCount();
DisableFullCodegenAndCrankshaft(kGetIterator); DisableFullCodegenAndCrankshaft(kGetIterator);
node->set_base_id(ReserveIdRange(GetIterator::num_ids()));
Visit(node->iterable()); Visit(node->iterable());
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
} }
...@@ -507,7 +487,6 @@ void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) { ...@@ -507,7 +487,6 @@ void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) {
void AstNumberingVisitor::VisitConditional(Conditional* node) { void AstNumberingVisitor::VisitConditional(Conditional* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(Conditional::num_ids()));
Visit(node->condition()); Visit(node->condition());
Visit(node->then_expression()); Visit(node->then_expression());
Visit(node->else_expression()); Visit(node->else_expression());
...@@ -516,7 +495,6 @@ void AstNumberingVisitor::VisitConditional(Conditional* node) { ...@@ -516,7 +495,6 @@ void AstNumberingVisitor::VisitConditional(Conditional* node) {
void AstNumberingVisitor::VisitIfStatement(IfStatement* node) { void AstNumberingVisitor::VisitIfStatement(IfStatement* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(IfStatement::num_ids()));
Visit(node->condition()); Visit(node->condition());
Visit(node->then_statement()); Visit(node->then_statement());
if (node->HasElseStatement()) { if (node->HasElseStatement()) {
...@@ -527,7 +505,6 @@ void AstNumberingVisitor::VisitIfStatement(IfStatement* node) { ...@@ -527,7 +505,6 @@ void AstNumberingVisitor::VisitIfStatement(IfStatement* node) {
void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) { void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(SwitchStatement::num_ids()));
Visit(node->tag()); Visit(node->tag());
ZoneList<CaseClause*>* cases = node->cases(); ZoneList<CaseClause*>* cases = node->cases();
for (int i = 0; i < cases->length(); i++) { for (int i = 0; i < cases->length(); i++) {
...@@ -538,7 +515,6 @@ void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) { ...@@ -538,7 +515,6 @@ void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) {
void AstNumberingVisitor::VisitCaseClause(CaseClause* node) { void AstNumberingVisitor::VisitCaseClause(CaseClause* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(CaseClause::num_ids()));
if (!node->is_default()) Visit(node->label()); if (!node->is_default()) Visit(node->label());
VisitStatements(node->statements()); VisitStatements(node->statements());
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
...@@ -561,7 +537,6 @@ void AstNumberingVisitor::VisitForStatement(ForStatement* node) { ...@@ -561,7 +537,6 @@ void AstNumberingVisitor::VisitForStatement(ForStatement* node) {
void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) { void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) {
IncrementNodeCount(); IncrementNodeCount();
DisableFullCodegenAndCrankshaft(kClassLiteral); DisableFullCodegenAndCrankshaft(kClassLiteral);
node->set_base_id(ReserveIdRange(ClassLiteral::num_ids()));
LanguageModeScope language_mode_scope(this, STRICT); LanguageModeScope language_mode_scope(this, STRICT);
if (node->extends()) Visit(node->extends()); if (node->extends()) Visit(node->extends());
if (node->constructor()) Visit(node->constructor()); if (node->constructor()) Visit(node->constructor());
...@@ -577,7 +552,6 @@ void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) { ...@@ -577,7 +552,6 @@ void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) {
void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) { void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(node->num_ids()));
for (int i = 0; i < node->properties()->length(); i++) { for (int i = 0; i < node->properties()->length(); i++) {
VisitLiteralProperty(node->properties()->at(i)); VisitLiteralProperty(node->properties()->at(i));
} }
...@@ -598,7 +572,6 @@ void AstNumberingVisitor::VisitLiteralProperty(LiteralProperty* node) { ...@@ -598,7 +572,6 @@ void AstNumberingVisitor::VisitLiteralProperty(LiteralProperty* node) {
void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) { void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(node->num_ids()));
for (int i = 0; i < node->values()->length(); i++) { for (int i = 0; i < node->values()->length(); i++) {
Visit(node->values()->at(i)); Visit(node->values()->at(i));
} }
...@@ -613,7 +586,6 @@ void AstNumberingVisitor::VisitCall(Call* node) { ...@@ -613,7 +586,6 @@ void AstNumberingVisitor::VisitCall(Call* node) {
} }
IncrementNodeCount(); IncrementNodeCount();
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
node->set_base_id(ReserveIdRange(Call::num_ids()));
Visit(node->expression()); Visit(node->expression());
VisitArguments(node->arguments()); VisitArguments(node->arguments());
} }
...@@ -622,7 +594,6 @@ void AstNumberingVisitor::VisitCall(Call* node) { ...@@ -622,7 +594,6 @@ void AstNumberingVisitor::VisitCall(Call* node) {
void AstNumberingVisitor::VisitCallNew(CallNew* node) { void AstNumberingVisitor::VisitCallNew(CallNew* node) {
IncrementNodeCount(); IncrementNodeCount();
ReserveFeedbackSlots(node); ReserveFeedbackSlots(node);
node->set_base_id(ReserveIdRange(CallNew::num_ids()));
Visit(node->expression()); Visit(node->expression());
VisitArguments(node->arguments()); VisitArguments(node->arguments());
} }
...@@ -650,7 +621,6 @@ void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) { ...@@ -650,7 +621,6 @@ void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) {
void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids()));
if (node->ShouldEagerCompile()) { if (node->ShouldEagerCompile()) {
if (eager_literals_) { if (eager_literals_) {
eager_literals_->Add(new (zone()) eager_literals_->Add(new (zone())
...@@ -671,7 +641,6 @@ void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { ...@@ -671,7 +641,6 @@ void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
void AstNumberingVisitor::VisitRewritableExpression( void AstNumberingVisitor::VisitRewritableExpression(
RewritableExpression* node) { RewritableExpression* node) {
IncrementNodeCount(); IncrementNodeCount();
node->set_base_id(ReserveIdRange(RewritableExpression::num_ids()));
Visit(node->expression()); Visit(node->expression());
} }
......
...@@ -851,26 +851,6 @@ void MaterializedLiteral::BuildConstants(Isolate* isolate) { ...@@ -851,26 +851,6 @@ void MaterializedLiteral::BuildConstants(Isolate* isolate) {
DCHECK(IsRegExpLiteral()); DCHECK(IsRegExpLiteral());
} }
void UnaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
// TODO(olivf) If this Operation is used in a test context, then the
// expression has a ToBoolean stub and we want to collect the type
// information. However the GraphBuilder expects it to be on the instruction
// corresponding to the TestContext, therefore we have to store it here and
// not on the operand.
set_to_boolean_types(oracle->ToBooleanTypes(expression()->test_id()));
}
void BinaryOperation::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
// TODO(olivf) If this Operation is used in a test context, then the right
// hand side has a ToBoolean stub and we want to collect the type information.
// However the GraphBuilder expects it to be on the instruction corresponding
// to the TestContext, therefore we have to store it here and not on the
// right hand operand.
set_to_boolean_types(oracle->ToBooleanTypes(right()->test_id()));
}
void BinaryOperation::AssignFeedbackSlots(FeedbackVectorSpec* spec, void BinaryOperation::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode, LanguageMode language_mode,
FeedbackSlotCache* cache) { FeedbackSlotCache* cache) {
...@@ -1004,19 +984,6 @@ bool CompareOperation::IsLiteralCompareNull(Expression** expr) { ...@@ -1004,19 +984,6 @@ bool CompareOperation::IsLiteralCompareNull(Expression** expr) {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Recording of type feedback // Recording of type feedback
// TODO(rossberg): all RecordTypeFeedback functions should disappear
// once we use the common type field in the AST consistently.
void Expression::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
if (IsUnaryOperation()) {
AsUnaryOperation()->RecordToBooleanTypeFeedback(oracle);
} else if (IsBinaryOperation()) {
AsBinaryOperation()->RecordToBooleanTypeFeedback(oracle);
} else {
set_to_boolean_types(oracle->ToBooleanTypes(test_id()));
}
}
void SmallMapList::AddMapIfMissing(Handle<Map> map, Zone* zone) { void SmallMapList::AddMapIfMissing(Handle<Map> map, Zone* zone) {
if (!Map::TryUpdate(map).ToHandle(&map)) return; if (!Map::TryUpdate(map).ToHandle(&map)) return;
for (int i = 0; i < length(); ++i) { for (int i = 0; i < length(); ++i) {
...@@ -1123,10 +1090,7 @@ Call::CallType Call::GetCallType() const { ...@@ -1123,10 +1090,7 @@ Call::CallType Call::GetCallType() const {
CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements, CaseClause::CaseClause(Expression* label, ZoneList<Statement*>* statements,
int pos) int pos)
: Expression(pos, kCaseClause), : Expression(pos, kCaseClause), label_(label), statements_(statements) {}
label_(label),
statements_(statements),
compare_type_(AstType::None()) {}
void CaseClause::AssignFeedbackSlots(FeedbackVectorSpec* spec, void CaseClause::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode, LanguageMode language_mode,
......
This diff is collapsed.
This diff is collapsed.
...@@ -210,18 +210,6 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> { ...@@ -210,18 +210,6 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
// Helper to indicate a node exits the function body. // Helper to indicate a node exits the function body.
void UpdateControlDependencyToLeaveFunction(Node* exit); void UpdateControlDependencyToLeaveFunction(Node* exit);
// Prepare information for lazy deoptimization. This information is attached
// to the given node and the output value produced by the node is combined.
// Conceptually this frame state is "after" a given operation.
void PrepareFrameState(Node* node, BailoutId ast_id,
OutputFrameStateCombine framestate_combine =
OutputFrameStateCombine::Ignore());
// Prepare information for eager deoptimization. This information is carried
// by dedicated {Checkpoint} nodes that are wired into the effect chain.
// Conceptually this frame state is "before" a given operation.
void PrepareEagerCheckpoint(BailoutId ast_id);
BitVector* GetVariablesAssignedInLoop(IterationStatement* stmt); BitVector* GetVariablesAssignedInLoop(IterationStatement* stmt);
// Check if the given statement is an OSR entry. // Check if the given statement is an OSR entry.
...@@ -252,15 +240,9 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> { ...@@ -252,15 +240,9 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
// Builders for variable load and assignment. // Builders for variable load and assignment.
Node* BuildVariableAssignment(Variable* variable, Node* value, Node* BuildVariableAssignment(Variable* variable, Node* value,
Token::Value op, const VectorSlotPair& slot, Token::Value op, const VectorSlotPair& slot);
BailoutId bailout_id, Node* BuildVariableDelete(Variable* variable);
OutputFrameStateCombine framestate_combine = Node* BuildVariableLoad(Variable* variable, const VectorSlotPair& feedback,
OutputFrameStateCombine::Ignore());
Node* BuildVariableDelete(Variable* variable, BailoutId bailout_id,
OutputFrameStateCombine framestate_combine);
Node* BuildVariableLoad(Variable* variable, BailoutId bailout_id,
const VectorSlotPair& feedback,
OutputFrameStateCombine framestate_combine,
TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); TypeofMode typeof_mode = NOT_INSIDE_TYPEOF);
// Builders for property loads and stores. // Builders for property loads and stores.
...@@ -286,8 +268,8 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> { ...@@ -286,8 +268,8 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
Node* BuildLoadNativeContextField(int index); Node* BuildLoadNativeContextField(int index);
// Builders for automatic type conversion. // Builders for automatic type conversion.
Node* BuildToBoolean(Node* input, TypeFeedbackId feedback_id); Node* BuildToBoolean(Node* input);
Node* BuildToObject(Node* input, BailoutId bailout_id); Node* BuildToObject(Node* input);
// Builder for adding the [[HomeObject]] to a value if the value came from a // Builder for adding the [[HomeObject]] to a value if the value came from a
// function literal and needs a home object. Do nothing otherwise. // function literal and needs a home object. Do nothing otherwise.
...@@ -295,23 +277,20 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> { ...@@ -295,23 +277,20 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
LiteralProperty* property, int slot_number = 0); LiteralProperty* property, int slot_number = 0);
// Builders for error reporting at runtime. // Builders for error reporting at runtime.
Node* BuildThrowError(Node* exception, BailoutId bailout_id); Node* BuildThrowError(Node* exception);
Node* BuildThrowReferenceError(Variable* var, BailoutId bailout_id); Node* BuildThrowReferenceError(Variable* var);
Node* BuildThrowConstAssignError(BailoutId bailout_id); Node* BuildThrowConstAssignError();
// Builders for dynamic hole-checks at runtime. // Builders for dynamic hole-checks at runtime.
Node* BuildHoleCheckThenThrow(Node* value, Variable* var, Node* not_hole, Node* BuildHoleCheckThenThrow(Node* value, Variable* var, Node* not_hole);
BailoutId bailout_id); Node* BuildHoleCheckElseThrow(Node* value, Variable* var, Node* for_hole);
Node* BuildHoleCheckElseThrow(Node* value, Variable* var, Node* for_hole,
BailoutId bailout_id);
// Builders for non-local control flow. // Builders for non-local control flow.
Node* BuildReturn(Node* return_value); Node* BuildReturn(Node* return_value);
Node* BuildThrow(Node* exception_value); Node* BuildThrow(Node* exception_value);
// Builders for binary operations. // Builders for binary operations.
Node* BuildBinaryOp(Node* left, Node* right, Token::Value op, Node* BuildBinaryOp(Node* left, Node* right, Token::Value op);
TypeFeedbackId feedback_id);
// Process arguments to a call by popping {arity} elements off the operand // Process arguments to a call by popping {arity} elements off the operand
// stack and build a call node using the given call operator. // stack and build a call node using the given call operator.
...@@ -349,8 +328,7 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> { ...@@ -349,8 +328,7 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
void VisitForValues(ZoneList<Expression*>* exprs); void VisitForValues(ZoneList<Expression*>* exprs);
// Common for all IterationStatement bodies. // Common for all IterationStatement bodies.
void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop, void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop);
BailoutId stack_check_id);
// Dispatched from VisitCall. // Dispatched from VisitCall.
void VisitCallSuper(Call* expr); void VisitCallSuper(Call* expr);
...@@ -460,12 +438,6 @@ class AstGraphBuilder::Environment : public ZoneObject { ...@@ -460,12 +438,6 @@ class AstGraphBuilder::Environment : public ZoneObject {
values()->erase(values()->end() - depth, values()->end()); values()->erase(values()->end() - depth, values()->end());
} }
// Preserve a checkpoint of the environment for the IR graph. Any
// further mutation of the environment will not affect checkpoints.
Node* Checkpoint(BailoutId ast_id, OutputFrameStateCombine combine =
OutputFrameStateCombine::Ignore(),
bool node_has_exception = false);
// Inserts a loop exit control node and renames the environment. // Inserts a loop exit control node and renames the environment.
// This is useful for loop peeling to insert phis at loop exits. // This is useful for loop peeling to insert phis at loop exits.
void PrepareForLoopExit(Node* loop, BitVector* assigned_variables); void PrepareForLoopExit(Node* loop, BitVector* assigned_variables);
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "src/crankshaft/hydrogen-store-elimination.h" #include "src/crankshaft/hydrogen-store-elimination.h"
#include "src/crankshaft/hydrogen-uint32-analysis.h" #include "src/crankshaft/hydrogen-uint32-analysis.h"
#include "src/crankshaft/lithium-allocator.h" #include "src/crankshaft/lithium-allocator.h"
#include "src/crankshaft/typing.h"
#include "src/field-type.h" #include "src/field-type.h"
#include "src/full-codegen/full-codegen.h" #include "src/full-codegen/full-codegen.h"
#include "src/globals.h" #include "src/globals.h"
...@@ -270,24 +269,6 @@ int HBasicBlock::LoopNestingDepth() const { ...@@ -270,24 +269,6 @@ int HBasicBlock::LoopNestingDepth() const {
} }
void HBasicBlock::PostProcessLoopHeader(IterationStatement* stmt) {
DCHECK(IsLoopHeader());
SetJoinId(stmt->EntryId());
if (predecessors()->length() == 1) {
// This is a degenerated loop.
DetachLoopInformation();
return;
}
// Only the first entry into the loop is from outside the loop. All other
// entries must be back edges.
for (int i = 1; i < predecessors()->length(); ++i) {
loop_information()->RegisterBackEdge(predecessors()->at(i));
}
}
void HBasicBlock::MarkSuccEdgeUnreachable(int succ) { void HBasicBlock::MarkSuccEdgeUnreachable(int succ) {
DCHECK(IsFinished()); DCHECK(IsFinished());
HBasicBlock* succ_block = end()->SuccessorAt(succ); HBasicBlock* succ_block = end()->SuccessorAt(succ);
......
...@@ -85,7 +85,6 @@ class HBasicBlock final : public ZoneObject { ...@@ -85,7 +85,6 @@ class HBasicBlock final : public ZoneObject {
void DetachLoopInformation(); void DetachLoopInformation();
bool IsLoopHeader() const { return loop_information() != NULL; } bool IsLoopHeader() const { return loop_information() != NULL; }
bool IsStartBlock() const { return block_id() == 0; } bool IsStartBlock() const { return block_id() == 0; }
void PostProcessLoopHeader(IterationStatement* stmt);
bool IsFinished() const { return end_ != NULL; } bool IsFinished() const { return end_ != NULL; }
void AddPhi(HPhi* phi); void AddPhi(HPhi* phi);
......
This diff is collapsed.
// Copyright 2013 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_CRANKSHAFT_TYPING_H_
#define V8_CRANKSHAFT_TYPING_H_
#include "src/allocation.h"
#include "src/ast/ast-type-bounds.h"
#include "src/ast/ast-types.h"
#include "src/ast/ast.h"
#include "src/ast/variables.h"
#include "src/effects.h"
#include "src/type-info.h"
#include "src/zone/zone.h"
namespace v8 {
namespace internal {
class DeclarationScope;
class Isolate;
class FunctionLiteral;
class AstTyper final : public AstVisitor<AstTyper> {
public:
AstTyper(Isolate* isolate, Zone* zone, Handle<JSFunction> closure,
DeclarationScope* scope, BailoutId osr_ast_id, FunctionLiteral* root,
AstTypeBounds* bounds);
void Run();
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
private:
Effect ObservedOnStack(Object* value);
void ObserveTypesAtOsrEntry(IterationStatement* stmt);
static const int kNoVar = INT_MIN;
typedef v8::internal::Effects<int, kNoVar> Effects;
typedef v8::internal::NestedEffects<int, kNoVar> Store;
Isolate* isolate_;
Zone* zone_;
Handle<JSFunction> closure_;
DeclarationScope* scope_;
BailoutId osr_ast_id_;
FunctionLiteral* root_;
TypeFeedbackOracle oracle_;
Store store_;
AstTypeBounds* bounds_;
Zone* zone() const { return zone_; }
TypeFeedbackOracle* oracle() { return &oracle_; }
void NarrowType(Expression* e, AstBounds b) {
bounds_->set(e, AstBounds::Both(bounds_->get(e), b, zone()));
}
void NarrowLowerType(Expression* e, AstType* t) {
bounds_->set(e, AstBounds::NarrowLower(bounds_->get(e), t, zone()));
}
Effects EnterEffects() {
store_ = store_.Push();
return store_.Top();
}
void ExitEffects() { store_ = store_.Pop(); }
int parameter_index(int index) { return -index - 2; }
int stack_local_index(int index) { return index; }
int variable_index(Variable* var);
void VisitDeclarations(Declaration::List* declarations);
void VisitStatements(ZoneList<Statement*>* statements);
#define DECLARE_VISIT(type) void Visit##type(type* node);
AST_NODE_LIST(DECLARE_VISIT)
#undef DECLARE_VISIT
DISALLOW_COPY_AND_ASSIGN(AstTyper);
};
} // namespace internal
} // namespace v8
#endif // V8_CRANKSHAFT_TYPING_H_
...@@ -619,7 +619,7 @@ void FullCodeGenerator::DoTest(Expression* condition, ...@@ -619,7 +619,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
Label* if_false, Label* if_false,
Label* fall_through) { Label* fall_through) {
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ CompareRoot(result_register(), Heap::kTrueValueRootIndex); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(eq, if_true, if_false, fall_through); Split(eq, if_true, if_false, fall_through);
} }
...@@ -870,7 +870,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -870,7 +870,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1244,14 +1244,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1244,14 +1244,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1508,7 +1506,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1508,7 +1506,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ jmp(&done); __ jmp(&done);
...@@ -1582,7 +1580,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1582,7 +1580,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(r1); PopOperand(r1);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(r0); context()->Plug(r0);
} }
...@@ -2358,7 +2356,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2358,7 +2356,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetExpressionPosition(expr); SetExpressionPosition(expr);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2543,7 +2541,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2543,7 +2541,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ cmp(r0, Operand::Zero()); __ cmp(r0, Operand::Zero());
Split(cond, if_true, if_false, fall_through); Split(cond, if_true, if_false, fall_through);
......
...@@ -608,7 +608,7 @@ void FullCodeGenerator::DoTest(Expression* condition, ...@@ -608,7 +608,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
Label* if_false, Label* if_false,
Label* fall_through) { Label* fall_through) {
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ CompareRoot(result_register(), Heap::kTrueValueRootIndex); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(eq, if_true, if_false, fall_through); Split(eq, if_true, if_false, fall_through);
} }
...@@ -863,7 +863,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -863,7 +863,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
} }
...@@ -1225,14 +1225,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1225,14 +1225,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1439,7 +1437,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1439,7 +1437,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ Bind(&stub_call); __ Bind(&stub_call);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ B(&done); __ B(&done);
...@@ -1523,7 +1521,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1523,7 +1521,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // Unbound, signals no inlined smi code.
{ {
Assembler::BlockPoolsScope scope(masm_); Assembler::BlockPoolsScope scope(masm_);
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
} }
context()->Plug(x0); context()->Plug(x0);
...@@ -2323,7 +2321,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2323,7 +2321,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetExpressionPosition(expr); SetExpressionPosition(expr);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ Bind(&done); __ Bind(&done);
...@@ -2519,7 +2517,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2519,7 +2517,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through); __ CompareAndSplit(x0, 0, cond, if_true, if_false, fall_through);
} }
......
...@@ -829,8 +829,7 @@ void FullCodeGenerator::VisitBlock(Block* stmt) { ...@@ -829,8 +829,7 @@ void FullCodeGenerator::VisitBlock(Block* stmt) {
NestedBlock nested_block(this, stmt); NestedBlock nested_block(this, stmt);
{ {
EnterBlockScopeIfNeeded block_scope_state( EnterBlockScopeIfNeeded block_scope_state(this, stmt->scope());
this, stmt->scope(), stmt->EntryId(), stmt->DeclsId(), stmt->ExitId());
VisitStatements(stmt->statements()); VisitStatements(stmt->statements());
__ bind(nested_block.break_label()); __ bind(nested_block.break_label());
} }
...@@ -1456,11 +1455,9 @@ bool BackEdgeTable::Verify(Isolate* isolate, Code* unoptimized) { ...@@ -1456,11 +1455,9 @@ bool BackEdgeTable::Verify(Isolate* isolate, Code* unoptimized) {
} }
#endif // DEBUG #endif // DEBUG
FullCodeGenerator::EnterBlockScopeIfNeeded::EnterBlockScopeIfNeeded( FullCodeGenerator::EnterBlockScopeIfNeeded::EnterBlockScopeIfNeeded(
FullCodeGenerator* codegen, Scope* scope, BailoutId entry_id, FullCodeGenerator* codegen, Scope* scope)
BailoutId declarations_id, BailoutId exit_id) : codegen_(codegen) {
: codegen_(codegen), exit_id_(exit_id) {
saved_scope_ = codegen_->scope(); saved_scope_ = codegen_->scope();
if (scope == NULL) { if (scope == NULL) {
......
...@@ -757,9 +757,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { ...@@ -757,9 +757,7 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
class EnterBlockScopeIfNeeded { class EnterBlockScopeIfNeeded {
public: public:
EnterBlockScopeIfNeeded(FullCodeGenerator* codegen, Scope* scope, EnterBlockScopeIfNeeded(FullCodeGenerator* codegen, Scope* scope);
BailoutId entry_id, BailoutId declarations_id,
BailoutId exit_id);
~EnterBlockScopeIfNeeded(); ~EnterBlockScopeIfNeeded();
private: private:
...@@ -767,7 +765,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> { ...@@ -767,7 +765,6 @@ class FullCodeGenerator final : public AstVisitor<FullCodeGenerator> {
FullCodeGenerator* codegen_; FullCodeGenerator* codegen_;
Scope* saved_scope_; Scope* saved_scope_;
BailoutId exit_id_;
bool needs_block_context_; bool needs_block_context_;
}; };
......
...@@ -565,7 +565,7 @@ void FullCodeGenerator::DoTest(Expression* condition, ...@@ -565,7 +565,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
Label* if_false, Label* if_false,
Label* fall_through) { Label* fall_through) {
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ CompareRoot(result_register(), Heap::kTrueValueRootIndex); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(equal, if_true, if_false, fall_through); Split(equal, if_true, if_false, fall_through);
} }
...@@ -810,7 +810,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -810,7 +810,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1162,14 +1162,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1162,14 +1162,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1421,7 +1419,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1421,7 +1419,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
__ mov(eax, ecx); __ mov(eax, ecx);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ jmp(&done, Label::kNear); __ jmp(&done, Label::kNear);
...@@ -1502,7 +1500,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1502,7 +1500,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(edx); PopOperand(edx);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(eax); context()->Plug(eax);
} }
...@@ -2286,7 +2284,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2286,7 +2284,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ mov(eax, Immediate(Smi::FromInt(1))); __ mov(eax, Immediate(Smi::FromInt(1)));
Handle<Code> code = Handle<Code> code =
CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2473,7 +2471,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2473,7 +2471,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ test(eax, eax); __ test(eax, eax);
......
...@@ -607,7 +607,7 @@ void FullCodeGenerator::DoTest(Expression* condition, ...@@ -607,7 +607,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
Label* fall_through) { Label* fall_through) {
__ mov(a0, result_register()); __ mov(a0, result_register());
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ LoadRoot(at, Heap::kTrueValueRootIndex); __ LoadRoot(at, Heap::kTrueValueRootIndex);
Split(eq, result_register(), Operand(at), if_true, if_false, fall_through); Split(eq, result_register(), Operand(at), if_true, if_false, fall_through);
} }
...@@ -862,7 +862,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -862,7 +862,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1235,14 +1235,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1235,14 +1235,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1516,7 +1514,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1516,7 +1514,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ jmp(&done); __ jmp(&done);
...@@ -1587,7 +1585,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1587,7 +1585,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(a1); PopOperand(a1);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(v0); context()->Plug(v0);
} }
...@@ -2374,7 +2372,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2374,7 +2372,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetExpressionPosition(expr); SetExpressionPosition(expr);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2562,7 +2560,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2562,7 +2560,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through);
} }
......
...@@ -607,7 +607,7 @@ void FullCodeGenerator::DoTest(Expression* condition, ...@@ -607,7 +607,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
Label* fall_through) { Label* fall_through) {
__ mov(a0, result_register()); __ mov(a0, result_register());
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ LoadRoot(at, Heap::kTrueValueRootIndex); __ LoadRoot(at, Heap::kTrueValueRootIndex);
Split(eq, result_register(), Operand(at), if_true, if_false, fall_through); Split(eq, result_register(), Operand(at), if_true, if_false, fall_through);
} }
...@@ -862,7 +862,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -862,7 +862,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1237,14 +1237,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1237,14 +1237,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1518,7 +1516,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1518,7 +1516,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ jmp(&done); __ jmp(&done);
...@@ -1588,7 +1586,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1588,7 +1586,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(a1); PopOperand(a1);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(v0); context()->Plug(v0);
} }
...@@ -2375,7 +2373,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2375,7 +2373,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetExpressionPosition(expr); SetExpressionPosition(expr);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2563,7 +2561,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2563,7 +2561,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through); Split(cc, v0, Operand(zero_reg), if_true, if_false, fall_through);
} }
......
...@@ -591,7 +591,7 @@ void FullCodeGenerator::TestContext::Plug(bool flag) const { ...@@ -591,7 +591,7 @@ void FullCodeGenerator::TestContext::Plug(bool flag) const {
void FullCodeGenerator::DoTest(Expression* condition, Label* if_true, void FullCodeGenerator::DoTest(Expression* condition, Label* if_true,
Label* if_false, Label* fall_through) { Label* if_false, Label* fall_through) {
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ CompareRoot(result_register(), Heap::kTrueValueRootIndex); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(eq, if_true, if_false, fall_through); Split(eq, if_true, if_false, fall_through);
} }
...@@ -830,7 +830,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -830,7 +830,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1210,14 +1210,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1210,14 +1210,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1485,7 +1483,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1485,7 +1483,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ b(&done); __ b(&done);
...@@ -1591,7 +1589,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1591,7 +1589,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(r4); PopOperand(r4);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(r3); context()->Plug(r3);
} }
...@@ -2365,7 +2363,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2365,7 +2363,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetExpressionPosition(expr); SetExpressionPosition(expr);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2553,7 +2551,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2553,7 +2551,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ cmpi(r3, Operand::Zero()); __ cmpi(r3, Operand::Zero());
Split(cond, if_true, if_false, fall_through); Split(cond, if_true, if_false, fall_through);
......
...@@ -573,7 +573,7 @@ void FullCodeGenerator::TestContext::Plug(bool flag) const { ...@@ -573,7 +573,7 @@ void FullCodeGenerator::TestContext::Plug(bool flag) const {
void FullCodeGenerator::DoTest(Expression* condition, Label* if_true, void FullCodeGenerator::DoTest(Expression* condition, Label* if_true,
Label* if_false, Label* fall_through) { Label* if_false, Label* fall_through) {
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ CompareRoot(result_register(), Heap::kTrueValueRootIndex); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(eq, if_true, if_false, fall_through); Split(eq, if_true, if_false, fall_through);
} }
...@@ -802,7 +802,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -802,7 +802,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1177,14 +1177,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1177,14 +1177,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1449,7 +1447,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1449,7 +1447,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ b(&done); __ b(&done);
...@@ -1567,7 +1565,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1567,7 +1565,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(r3); PopOperand(r3);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(r2); context()->Plug(r2);
} }
...@@ -2325,7 +2323,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2325,7 +2323,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
SetExpressionPosition(expr); SetExpressionPosition(expr);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), Token::ADD).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2509,7 +2507,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2509,7 +2507,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ CmpP(r2, Operand::Zero()); __ CmpP(r2, Operand::Zero());
Split(cond, if_true, if_false, fall_through); Split(cond, if_true, if_false, fall_through);
......
...@@ -576,7 +576,7 @@ void FullCodeGenerator::DoTest(Expression* condition, ...@@ -576,7 +576,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
Label* if_false, Label* if_false,
Label* fall_through) { Label* fall_through) {
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ CompareRoot(result_register(), Heap::kTrueValueRootIndex); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(equal, if_true, if_false, fall_through); Split(equal, if_true, if_false, fall_through);
} }
...@@ -823,7 +823,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -823,7 +823,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1189,14 +1189,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1189,14 +1189,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1444,7 +1442,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1444,7 +1442,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
__ movp(rax, rcx); __ movp(rax, rcx);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ jmp(&done, Label::kNear); __ jmp(&done, Label::kNear);
...@@ -1491,7 +1489,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1491,7 +1489,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(rdx); PopOperand(rdx);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(rax); context()->Plug(rax);
} }
...@@ -2268,7 +2266,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2268,7 +2266,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ Move(rax, Smi::FromInt(1)); __ Move(rax, Smi::FromInt(1));
Handle<Code> code = Handle<Code> code =
CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2455,7 +2453,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2455,7 +2453,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ testp(rax, rax); __ testp(rax, rax);
......
...@@ -560,7 +560,7 @@ void FullCodeGenerator::DoTest(Expression* condition, ...@@ -560,7 +560,7 @@ void FullCodeGenerator::DoTest(Expression* condition,
Label* if_false, Label* if_false,
Label* fall_through) { Label* fall_through) {
Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate()); Handle<Code> ic = ToBooleanICStub::GetUninitialized(isolate());
CallIC(ic, condition->test_id()); CallIC(ic);
__ CompareRoot(result_register(), Heap::kTrueValueRootIndex); __ CompareRoot(result_register(), Heap::kTrueValueRootIndex);
Split(equal, if_true, if_false, fall_through); Split(equal, if_true, if_false, fall_through);
} }
...@@ -800,7 +800,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) { ...@@ -800,7 +800,7 @@ void FullCodeGenerator::VisitSwitchStatement(SwitchStatement* stmt) {
SetExpressionPosition(clause); SetExpressionPosition(clause);
Handle<Code> ic = Handle<Code> ic =
CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code(); CodeFactory::CompareIC(isolate(), Token::EQ_STRICT).code();
CallIC(ic, clause->CompareId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
Label skip; Label skip;
...@@ -1152,14 +1152,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1152,14 +1152,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
case ObjectLiteral::Property::GETTER: case ObjectLiteral::Property::GETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->getter = property; it->second->getter = property;
} }
break; break;
case ObjectLiteral::Property::SETTER: case ObjectLiteral::Property::SETTER:
if (property->emit_store()) { if (property->emit_store()) {
AccessorTable::Iterator it = accessor_table.lookup(key); AccessorTable::Iterator it = accessor_table.lookup(key);
it->second->bailout_id = expr->GetIdForPropertySet(i);
it->second->setter = property; it->second->setter = property;
} }
break; break;
...@@ -1411,7 +1409,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr, ...@@ -1411,7 +1409,7 @@ void FullCodeGenerator::EmitInlineSmiBinaryOp(BinaryOperation* expr,
__ bind(&stub_call); __ bind(&stub_call);
__ mov(eax, ecx); __ mov(eax, ecx);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ jmp(&done, Label::kNear); __ jmp(&done, Label::kNear);
...@@ -1492,7 +1490,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { ...@@ -1492,7 +1490,7 @@ void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
PopOperand(edx); PopOperand(edx);
Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code(); Handle<Code> code = CodeFactory::BinaryOpIC(isolate(), op).code();
JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
CallIC(code, expr->BinaryOperationFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
context()->Plug(eax); context()->Plug(eax);
} }
...@@ -2276,7 +2274,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { ...@@ -2276,7 +2274,7 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ mov(eax, Immediate(Smi::FromInt(1))); __ mov(eax, Immediate(Smi::FromInt(1)));
Handle<Code> code = Handle<Code> code =
CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code(); CodeFactory::BinaryOpIC(isolate(), expr->binary_op()).code();
CallIC(code, expr->CountBinOpFeedbackId()); CallIC(code);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ bind(&done); __ bind(&done);
...@@ -2463,7 +2461,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { ...@@ -2463,7 +2461,7 @@ void FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) {
} }
Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code(); Handle<Code> ic = CodeFactory::CompareIC(isolate(), op).code();
CallIC(ic, expr->CompareOperationFeedbackId()); CallIC(ic);
patch_site.EmitPatchInfo(); patch_site.EmitPatchInfo();
__ test(eax, eax); __ test(eax, eax);
......
...@@ -970,8 +970,6 @@ ...@@ -970,8 +970,6 @@
'crankshaft/lithium.cc', 'crankshaft/lithium.cc',
'crankshaft/lithium.h', 'crankshaft/lithium.h',
'crankshaft/lithium-inl.h', 'crankshaft/lithium-inl.h',
'crankshaft/typing.cc',
'crankshaft/typing.h',
'crankshaft/unique.h', 'crankshaft/unique.h',
'date.cc', 'date.cc',
'date.h', 'date.h',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment