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

Unified Diff: src/crankshaft/hydrogen.cc

Issue 2396023002: [crankshaft] Remove HLoadGlobalGeneric and use HCallWithDescriptor instead to call LoadGlobalIC. (Closed)
Patch Set: Created 4 years, 2 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/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen.cc
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index 6adb62fc166b3880ad364d9225920e457d2a2918..76ff46df51310f485d5d01d03104c61cafa00fae 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -5590,9 +5590,16 @@ void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
}
} else {
Handle<TypeFeedbackVector> vector(current_feedback_vector(), isolate());
- HLoadGlobalGeneric* instr = New<HLoadGlobalGeneric>(
- variable->name(), ast_context()->typeof_mode(), vector,
- expr->VariableFeedbackSlot());
+
+ HValue* vector_value = Add<HConstant>(vector);
+ HValue* slot_value =
+ Add<HConstant>(vector->GetIndex(expr->VariableFeedbackSlot()));
+ Callable callable = CodeFactory::LoadGlobalICInOptimizedCode(
+ isolate(), ast_context()->typeof_mode());
+ HValue* stub = Add<HConstant>(callable.code());
+ HValue* values[] = {context(), slot_value, vector_value};
+ HCallWithDescriptor* instr = New<HCallWithDescriptor>(
+ stub, 0, callable.descriptor(), ArrayVector(values));
return ast_context()->ReturnInstruction(instr, expr->id());
}
}
« no previous file with comments | « src/crankshaft/arm64/lithium-codegen-arm64.cc ('k') | src/crankshaft/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698