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

Unified Diff: src/hydrogen-instructions.h

Issue 23022005: Fix Math.round/floor that had bogus Smi representation (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index 307ed80415b324c476a0b1fc31806ac488db2b8a..7eae85b519d0206c84d51f74a05945e702b05c59 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -2433,21 +2433,6 @@ class HUnaryMathOperation: public HTemplateInstruction<2> {
}
}
- virtual void UpdateRepresentation(Representation new_rep,
- HInferRepresentationPhase* h_infer,
- const char* reason) {
- if (flexible_int() && !new_rep.IsSmi()) {
- new_rep = Representation::Integer32();
- }
- HValue::UpdateRepresentation(new_rep, h_infer, reason);
- }
-
- virtual void RepresentationChanged(Representation new_rep) {
- if (flexible_int() && new_rep.IsInteger32()) {
- ClearFlag(kFlexibleRepresentation);
- }
- }
-
virtual Range* InferRange(Zone* zone);
virtual HValue* Canonicalize();
@@ -2465,10 +2450,6 @@ class HUnaryMathOperation: public HTemplateInstruction<2> {
}
private:
- bool flexible_int() {
- return op_ == kMathFloor || op_ == kMathRound;
- }
-
HUnaryMathOperation(HValue* context, HValue* value, BuiltinFunctionId op)
: HTemplateInstruction<2>(HType::TaggedNumber()), op_(op) {
SetOperandAt(0, context);
@@ -2476,8 +2457,7 @@ class HUnaryMathOperation: public HTemplateInstruction<2> {
switch (op) {
case kMathFloor:
case kMathRound:
- set_representation(Representation::Smi());
- SetFlag(kFlexibleRepresentation);
+ set_representation(Representation::Integer32());
break;
case kMathAbs:
// Not setting representation here: it is None intentionally.
« no previous file with comments | « no previous file | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698