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

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

Issue 1205473004: [turbofan] Make global variable loads and stores explicit. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/compiler/js-typed-lowering.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index f57d8c00279db70ec46a3108f3791ccaadbb2a76..2d1c89f98281867c969453436310c8d44f005aa9 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -801,18 +801,14 @@ Reduction JSTypedLowering::ReduceJSToString(Node* node) {
}
-Reduction JSTypedLowering::ReduceJSLoadNamed(Node* node) {
- Node* object = NodeProperties::GetValueInput(node, 0);
- Type* object_type = NodeProperties::GetBounds(object).upper;
- if (object_type->Is(Type::GlobalObject())) {
- // Optimize global constants like "undefined", "Infinity", and "NaN".
- Handle<Name> name = LoadNamedParametersOf(node->op()).name().handle();
- Handle<Object> constant_value = factory()->GlobalConstantFor(name);
- if (!constant_value.is_null()) {
- Node* constant = jsgraph()->Constant(constant_value);
- ReplaceWithValue(node, constant);
- return Replace(constant);
- }
+Reduction JSTypedLowering::ReduceJSLoadGlobal(Node* node) {
+ // Optimize global constants like "undefined", "Infinity", and "NaN".
+ Handle<Name> name = LoadGlobalParametersOf(node->op()).name().handle();
+ Handle<Object> constant_value = factory()->GlobalConstantFor(name);
+ if (!constant_value.is_null()) {
+ Node* constant = jsgraph()->Constant(constant_value);
+ ReplaceWithValue(node, constant);
+ return Replace(constant);
}
return NoChange();
}
@@ -1023,7 +1019,7 @@ Reduction JSTypedLowering::ReduceJSLoadDynamicGlobal(Node* node) {
javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true), context,
context, effect);
Node* fast = graph()->NewNode(
- javascript()->LoadNamed(name, access.feedback(), access.mode()), global,
+ javascript()->LoadGlobal(name, access.feedback(), access.mode()), global,
vector, context, state1, state2, global, check_true);
// Slow case, because variable potentially shadowed. Perform dynamic lookup.
@@ -1639,8 +1635,8 @@ Reduction JSTypedLowering::Reduce(Node* node) {
return ReduceJSToNumber(node);
case IrOpcode::kJSToString:
return ReduceJSToString(node);
- case IrOpcode::kJSLoadNamed:
- return ReduceJSLoadNamed(node);
+ case IrOpcode::kJSLoadGlobal:
+ return ReduceJSLoadGlobal(node);
case IrOpcode::kJSLoadProperty:
return ReduceJSLoadProperty(node);
case IrOpcode::kJSStoreProperty:
« no previous file with comments | « src/compiler/js-typed-lowering.h ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698