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

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

Issue 2780953003: [turbofan] Remove typeof optimization from typed lowering. (Closed)
Patch Set: Created 3 years, 9 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') | no next file » | 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 34deb8e03cdcbb9cc1d86fa4c3355bf605346d1e..2b49cddd8120f676ce69058de1ca9b272f68c585 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -842,63 +842,7 @@ Reduction JSTypedLowering::ReduceJSTypeOf(Node* node) {
return NoChange();
}
-Reduction JSTypedLowering::ReduceJSEqualTypeOf(Node* node) {
- Node* input;
- Handle<String> type;
- HeapObjectBinopMatcher m(node);
- if (m.left().IsJSTypeOf() && m.right().HasValue() &&
- m.right().Value()->IsString()) {
- input = m.left().InputAt(0);
- type = Handle<String>::cast(m.right().Value());
- } else if (m.right().IsJSTypeOf() && m.left().HasValue() &&
- m.left().Value()->IsString()) {
- input = m.right().InputAt(0);
- type = Handle<String>::cast(m.left().Value());
- } else {
- return NoChange();
- }
- Node* value;
- if (String::Equals(type, factory()->boolean_string())) {
- value =
- graph()->NewNode(common()->Select(MachineRepresentation::kTagged),
- graph()->NewNode(simplified()->ReferenceEqual(), input,
- jsgraph()->TrueConstant()),
- jsgraph()->TrueConstant(),
- graph()->NewNode(simplified()->ReferenceEqual(), input,
- jsgraph()->FalseConstant()));
- } else if (String::Equals(type, factory()->function_string())) {
- value = graph()->NewNode(simplified()->ObjectIsDetectableCallable(), input);
- } else if (String::Equals(type, factory()->number_string())) {
- value = graph()->NewNode(simplified()->ObjectIsNumber(), input);
- } else if (String::Equals(type, factory()->object_string())) {
- value = graph()->NewNode(
- common()->Select(MachineRepresentation::kTagged),
- graph()->NewNode(simplified()->ObjectIsNonCallable(), input),
- jsgraph()->TrueConstant(),
- graph()->NewNode(simplified()->ReferenceEqual(), input,
- jsgraph()->NullConstant()));
- } else if (String::Equals(type, factory()->string_string())) {
- value = graph()->NewNode(simplified()->ObjectIsString(), input);
- } else if (String::Equals(type, factory()->symbol_string())) {
- value = graph()->NewNode(simplified()->ObjectIsSymbol(), input);
- } else if (String::Equals(type, factory()->undefined_string())) {
- value = graph()->NewNode(
- common()->Select(MachineRepresentation::kTagged),
- graph()->NewNode(simplified()->ReferenceEqual(), input,
- jsgraph()->NullConstant()),
- jsgraph()->FalseConstant(),
- graph()->NewNode(simplified()->ObjectIsUndetectable(), input));
- } else {
- return NoChange();
- }
- ReplaceWithValue(node, value);
- return Replace(value);
-}
-
Reduction JSTypedLowering::ReduceJSEqual(Node* node) {
- Reduction const reduction = ReduceJSEqualTypeOf(node);
- if (reduction.Changed()) return reduction;
-
JSBinopReduction r(this, node);
if (r.BothInputsAre(Type::UniqueName())) {
@@ -961,9 +905,6 @@ Reduction JSTypedLowering::ReduceJSStrictEqual(Node* node) {
}
}
- Reduction const reduction = ReduceJSEqualTypeOf(node);
- if (reduction.Changed()) return reduction;
-
if (r.BothInputsAre(Type::Unique())) {
return r.ChangeToPureOperator(simplified()->ReferenceEqual());
}
« no previous file with comments | « src/compiler/js-typed-lowering.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698