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

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

Issue 425003004: Implement representation selection as part of SimplifiedLowering. Representation selection also req… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added better tests for Load/Store of fields and elements, with both tagged and untagged bases. Created 6 years, 4 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/representation-change.h » ('j') | src/compiler/simplified-lowering.cc » ('J')
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 361cb94f058c3e39ce117c69ba3b44c32a91039c..a9b7493841ba61706bda171c993484344fdc94c0 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -515,6 +515,16 @@ Reduction JSTypedLowering::ReduceJSToBooleanInput(Node* input) {
cmp->ReplaceInput(0, input);
return Changed(inv);
}
+ if (input_type->Is(Type::Number())) {
rossberg 2014/08/06 13:04:07 Why is this duplicated?
+ // JSToBoolean(number) => BooleanNot(NumberEqual(x, #0))
+ Node* cmp = graph()->NewNode(simplified()->NumberEqual(), input,
+ jsgraph()->ZeroConstant());
+ Node* inv = graph()->NewNode(simplified()->BooleanNot(), cmp);
+ ReplaceEagerly(input, inv);
+ // TODO(titzer): Ugly. ReplaceEagerly() smashes all uses. So smash it back.
+ cmp->ReplaceInput(0, input);
+ return Changed(inv);
+ }
// TODO(turbofan): js-typed-lowering of ToBoolean(string)
return NoChange();
}
« no previous file with comments | « no previous file | src/compiler/representation-change.h » ('j') | src/compiler/simplified-lowering.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698