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

Unified Diff: src/compiler/js-generic-lowering.cc

Issue 1238143002: [stubs] Optimize LoadGlobalViaContextStub and StoreGlobalViaContextStub. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ARM typo. Created 5 years, 5 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
Index: src/compiler/js-generic-lowering.cc
diff --git a/src/compiler/js-generic-lowering.cc b/src/compiler/js-generic-lowering.cc
index e3e4cddd8a3697723d31b376527f2b876153ca56..17b1597edbe0f3af9d0bf514849fbee45dac55af 100644
--- a/src/compiler/js-generic-lowering.cc
+++ b/src/compiler/js-generic-lowering.cc
@@ -338,10 +338,10 @@ void JSGenericLowering::LowerJSLoadGlobal(Node* node) {
if (p.slot_index() >= 0) {
Callable callable = CodeFactory::LoadGlobalViaContext(isolate(), 0);
Node* script_context = node->InputAt(0);
- node->ReplaceInput(0, jsgraph()->SmiConstant(0));
- node->ReplaceInput(1, jsgraph()->SmiConstant(p.slot_index()));
- node->ReplaceInput(2, jsgraph()->HeapConstant(p.name()));
- node->ReplaceInput(3, script_context); // Replace old context.
+ node->ReplaceInput(0, jsgraph()->Int32Constant(p.slot_index()));
+ node->ReplaceInput(1, jsgraph()->HeapConstant(p.name()));
+ node->ReplaceInput(2, script_context); // Set new context...
+ node->RemoveInput(3); // ...instead of old one.
ReplaceWithStubCall(node, callable, flags);
} else {
@@ -397,11 +397,11 @@ void JSGenericLowering::LowerJSStoreGlobal(Node* node) {
CodeFactory::StoreGlobalViaContext(isolate(), 0, p.language_mode());
Node* script_context = node->InputAt(0);
Node* value = node->InputAt(2);
- node->ReplaceInput(0, jsgraph()->SmiConstant(0));
- node->ReplaceInput(1, jsgraph()->SmiConstant(p.slot_index()));
- node->ReplaceInput(2, jsgraph()->HeapConstant(p.name()));
- node->ReplaceInput(3, value);
- node->ReplaceInput(4, script_context); // Replace old context.
+ node->ReplaceInput(0, jsgraph()->Int32Constant(p.slot_index()));
+ node->ReplaceInput(1, jsgraph()->HeapConstant(p.name()));
+ node->ReplaceInput(2, value);
+ node->ReplaceInput(3, script_context); // Set new context...
+ node->RemoveInput(4); // ...instead of old one.
ReplaceWithStubCall(node, callable, flags);
} else {

Powered by Google App Engine
This is Rietveld 408576698