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

Unified Diff: src/compiler/typer.cc

Issue 2305383002: [turbofan] Nuke the context types. (Closed)
Patch Set: Created 4 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 | « no previous file | src/compiler/verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index 67d11370e4b41f14198d23090bac515580b835f0..a90fcdfd646b25499fbe01899a2cdb8330a47608 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -227,7 +227,6 @@ class Typer::Visitor : public Reducer {
return TypeOrNone(operand_node);
}
- Type* WrapContextTypeForInput(Node* node);
Type* Weaken(Node* node, Type* current_type, Type* previous_type);
Zone* zone() { return typer_->zone(); }
@@ -1227,11 +1226,15 @@ Type* Typer::Visitor::TypeJSInstanceOf(Node* node) { return Type::Boolean(); }
Type* Typer::Visitor::TypeJSLoadContext(Node* node) {
ContextAccess const& access = ContextAccessOf(node->op());
- if (access.index() == Context::EXTENSION_INDEX) {
- return Type::TaggedPointer();
+ switch (access.index()) {
+ case Context::PREVIOUS_INDEX:
+ case Context::NATIVE_CONTEXT_INDEX:
+ return Type::OtherInternal();
+ case Context::CLOSURE_INDEX:
+ return Type::Function();
+ default:
+ return Type::Any();
}
- // Since contexts are mutable, we just return the top.
- return Type::Any();
}
@@ -1241,42 +1244,26 @@ Type* Typer::Visitor::TypeJSStoreContext(Node* node) {
}
-Type* Typer::Visitor::WrapContextTypeForInput(Node* node) {
- Type* outer = TypeOrNone(NodeProperties::GetContextInput(node));
- if (outer->Is(Type::None())) {
- return Type::None();
- } else {
- DCHECK(outer->Maybe(Type::OtherInternal()));
- return Type::Context(outer, zone());
- }
-}
-
-
Type* Typer::Visitor::TypeJSCreateFunctionContext(Node* node) {
- return WrapContextTypeForInput(node);
+ return Type::OtherInternal();
}
-
Type* Typer::Visitor::TypeJSCreateCatchContext(Node* node) {
- return WrapContextTypeForInput(node);
+ return Type::OtherInternal();
}
-
Type* Typer::Visitor::TypeJSCreateWithContext(Node* node) {
- return WrapContextTypeForInput(node);
+ return Type::OtherInternal();
}
-
Type* Typer::Visitor::TypeJSCreateBlockContext(Node* node) {
- return WrapContextTypeForInput(node);
+ return Type::OtherInternal();
}
-
Type* Typer::Visitor::TypeJSCreateScriptContext(Node* node) {
- return WrapContextTypeForInput(node);
+ return Type::OtherInternal();
}
-
// JS other operators.
« no previous file with comments | « no previous file | src/compiler/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698