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

Unified Diff: src/hydrogen.cc

Issue 23889006: Use ast_id (id) instead of return_id (LoadId) in simulates for load instructions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 426fad4c6852e76093358531f51a0f8092e460bb..25522e87ec0b128fd4f020486e4fbb06c5162a8a 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4655,14 +4655,14 @@ static bool PrototypeChainCanNeverResolve(
void HOptimizedGraphBuilder::HandlePolymorphicLoadNamedField(
int position,
- BailoutId return_id,
+ BailoutId ast_id,
HValue* object,
SmallMapList* types,
Handle<String> name) {
HInstruction* instr = TryLoadPolymorphicAsMonomorphic(object, types, name);
if (instr != NULL) {
instr->set_position(position);
- return ast_context()->ReturnInstruction(instr, return_id);
+ return ast_context()->ReturnInstruction(instr, ast_id);
}
// Something did not match; must use a polymorphic load.
@@ -4734,14 +4734,14 @@ void HOptimizedGraphBuilder::HandlePolymorphicLoadNamedField(
if (join != NULL) {
current_block()->Goto(join);
} else {
- Add<HSimulate>(return_id, REMOVABLE_SIMULATE);
+ Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
if (!ast_context()->IsEffect()) ast_context()->ReturnValue(Pop());
return;
}
}
ASSERT(join != NULL);
- join->SetJoinId(return_id);
+ join->SetJoinId(ast_id);
set_current_block(join);
if (!ast_context()->IsEffect()) ast_context()->ReturnValue(Pop());
}
@@ -5122,7 +5122,7 @@ void HOptimizedGraphBuilder::HandleCompoundAssignment(Assignment* expr) {
// Named property.
CHECK_ALIVE(VisitForValue(prop->obj()));
HValue* object = Top();
- PushLoad(prop, object, expr->position(), expr->id(), prop->LoadId());
+ PushLoad(prop, object, expr->position());
CHECK_ALIVE(VisitForValue(expr->value()));
HValue* right = Pop();
@@ -5825,19 +5825,16 @@ bool HOptimizedGraphBuilder::TryArgumentsAccess(Property* expr) {
void HOptimizedGraphBuilder::PushLoad(Property* expr,
HValue* object,
- int position,
- BailoutId ast_id,
- BailoutId return_id) {
+ int position) {
ValueContext for_value(this, ARGUMENTS_NOT_ALLOWED);
Push(object);
- BuildLoad(expr, position, ast_id, return_id);
+ BuildLoad(expr, position, expr->LoadId());
}
void HOptimizedGraphBuilder::BuildLoad(Property* expr,
int position,
- BailoutId ast_id,
- BailoutId return_id) {
+ BailoutId ast_id) {
HInstruction* instr = NULL;
if (expr->IsStringLength()) {
HValue* string = Pop();
@@ -5879,7 +5876,10 @@ void HOptimizedGraphBuilder::BuildLoad(Property* expr,
Handle<JSObject> holder;
if (LookupGetter(map, name, &getter, &holder)) {
AddCheckConstantFunction(holder, Top(), map);
- if (FLAG_inline_accessors && TryInlineGetter(getter, return_id)) return;
+ if (FLAG_inline_accessors &&
+ TryInlineGetter(getter, ast_id, expr->LoadId())) {
+ return;
+ }
Add<HPushArgument>(Pop());
instr = new(zone()) HCallConstantFunction(getter, 1);
} else {
@@ -5887,7 +5887,7 @@ void HOptimizedGraphBuilder::BuildLoad(Property* expr,
}
} else if (types != NULL && types->length() > 1) {
return HandlePolymorphicLoadNamedField(
- position, return_id, Pop(), types, name);
+ position, ast_id, Pop(), types, name);
} else {
instr = BuildLoadNamedGeneric(Pop(), name, expr);
}
@@ -5900,22 +5900,22 @@ void HOptimizedGraphBuilder::BuildLoad(Property* expr,
bool has_side_effects = false;
HValue* load = HandleKeyedElementAccess(
- obj, key, NULL, expr, return_id, position,
+ obj, key, NULL, expr, ast_id, position,
false, // is_store
&has_side_effects);
if (has_side_effects) {
if (ast_context()->IsEffect()) {
- Add<HSimulate>(return_id, REMOVABLE_SIMULATE);
+ Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
} else {
Push(load);
- Add<HSimulate>(return_id, REMOVABLE_SIMULATE);
+ Add<HSimulate>(ast_id, REMOVABLE_SIMULATE);
Drop(1);
}
}
return ast_context()->ReturnValue(load);
}
instr->set_position(position);
- return ast_context()->ReturnInstruction(instr, return_id);
+ return ast_context()->ReturnInstruction(instr, ast_id);
}
@@ -5927,7 +5927,7 @@ void HOptimizedGraphBuilder::VisitProperty(Property* expr) {
if (TryArgumentsAccess(expr)) return;
CHECK_ALIVE(VisitForValue(expr->obj()));
- BuildLoad(expr, expr->position(), expr->id(), expr->id());
+ BuildLoad(expr, expr->position(), expr->id());
}
@@ -6604,12 +6604,13 @@ bool HOptimizedGraphBuilder::TryInlineConstruct(CallNew* expr,
bool HOptimizedGraphBuilder::TryInlineGetter(Handle<JSFunction> getter,
+ BailoutId ast_id,
BailoutId return_id) {
return TryInline(CALL_AS_METHOD,
getter,
0,
NULL,
- return_id,
+ ast_id,
return_id,
GETTER_CALL_RETURN);
}
@@ -7560,7 +7561,7 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
CHECK_ALIVE(VisitForValue(prop->obj()));
HValue* object = Top();
- PushLoad(prop, object, expr->position(), expr->id(), prop->LoadId());
+ PushLoad(prop, object, expr->position());
after = BuildIncrement(returns_original_input, expr);
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698