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

Unified Diff: src/compiler/js-type-feedback.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-type-feedback.h ('k') | src/compiler/js-typed-lowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-type-feedback.cc
diff --git a/src/compiler/js-type-feedback.cc b/src/compiler/js-type-feedback.cc
index 22ebf480c76f3191ccab90f397ae4be9c6abfdd6..432e2d0366620bcc93c7388db47fd6d2af33fb90 100644
--- a/src/compiler/js-type-feedback.cc
+++ b/src/compiler/js-type-feedback.cc
@@ -52,6 +52,8 @@ Reduction JSTypeFeedbackSpecializer::Reduce(Node* node) {
return ReduceJSLoadProperty(node);
case IrOpcode::kJSLoadNamed:
return ReduceJSLoadNamed(node);
+ case IrOpcode::kJSLoadGlobal:
+ return ReduceJSLoadGlobal(node);
case IrOpcode::kJSStoreNamed:
return ReduceJSStoreNamed(node);
case IrOpcode::kJSStoreProperty:
@@ -137,19 +139,8 @@ static bool GetInObjectFieldAccess(LoadOrStore mode, Handle<Map> map,
}
-static bool IsGlobalObject(Node* node) {
- return NodeProperties::IsTyped(node) &&
- NodeProperties::GetBounds(node).upper->Is(Type::GlobalObject());
-}
-
-
Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamed(Node* node) {
DCHECK(node->opcode() == IrOpcode::kJSLoadNamed);
- Node* receiver = node->InputAt(0);
- if (IsGlobalObject(receiver)) {
- return ReduceJSLoadNamedForGlobalVariable(node);
- }
-
if (mode() != kDeoptimizationEnabled) return NoChange();
Node* frame_state_before = GetFrameStateBefore(node);
if (frame_state_before == nullptr) return NoChange();
@@ -166,6 +157,7 @@ Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamed(Node* node) {
}
oracle()->PropertyReceiverTypes(slot, name, &maps);
+ Node* receiver = node->InputAt(0);
Node* effect = NodeProperties::GetEffectInput(node);
if (maps.length() != 1) return NoChange(); // TODO(turbofan): polymorphism
@@ -196,10 +188,10 @@ Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamed(Node* node) {
}
-Reduction JSTypeFeedbackSpecializer::ReduceJSLoadNamedForGlobalVariable(
- Node* node) {
+Reduction JSTypeFeedbackSpecializer::ReduceJSLoadGlobal(Node* node) {
+ DCHECK(node->opcode() == IrOpcode::kJSLoadGlobal);
Handle<String> name =
- Handle<String>::cast(LoadNamedParametersOf(node->op()).name().handle());
+ Handle<String>::cast(LoadGlobalParametersOf(node->op()).name().handle());
// Try to optimize loads from the global object.
Handle<Object> constant_value =
jsgraph()->isolate()->factory()->GlobalConstantFor(name);
« no previous file with comments | « src/compiler/js-type-feedback.h ('k') | src/compiler/js-typed-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698