Reviewers: Michael Starzinger,

Description:
Undo some unintended changes from the Turbofan merge

[email protected]
BUG=

Please review this at https://codereview.chromium.org/435423002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+26, -15 lines):
  M src/types.h
  M src/types.cc


Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index 6205c4a8d810ddd76c8c3f6045a551f018ce81ef..c4e32f7823e6a15ac684a163c864b5de929bcc25 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -123,21 +123,31 @@ int TypeImpl<Config>::BitsetType::Lub(double value) {
   DisallowHeapAllocation no_allocation;
   if (i::IsMinusZero(value)) return kMinusZero;
   if (std::isnan(value)) return kNaN;
-  if (IsUint32Double(value)) {
-    uint32_t u = FastD2UI(value);
-    if (u < 0x40000000u) return kUnsignedSmall;
-    if (u < 0x80000000u) {
-      return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
-    }
-    return kOtherUnsigned32;
+  if (IsUint32Double(value)) return Lub(FastD2UI(value));
+  if (IsInt32Double(value)) return Lub(FastD2I(value));
+  return kOtherNumber;
+}
+
+
+template<class Config>
+int TypeImpl<Config>::BitsetType::Lub(int32_t value) {
+  if (value >= 0x40000000) {
+    return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
   }
-  if (IsInt32Double(value)) {
-    int32_t i = FastD2I(value);
-    DCHECK(i < 0);
-    if (i >= -0x40000000) return kOtherSignedSmall;
-    return i::SmiValuesAre31Bits() ? kOtherSigned32 : kOtherSignedSmall;
+  if (value >= 0) return kUnsignedSmall;
+  if (value >= -0x40000000) return kOtherSignedSmall;
+  return i::SmiValuesAre31Bits() ? kOtherSigned32 : kOtherSignedSmall;
+}
+
+
+template<class Config>
+int TypeImpl<Config>::BitsetType::Lub(uint32_t value) {
+  DisallowHeapAllocation no_allocation;
+  if (value >= 0x80000000u) return kOtherUnsigned32;
+  if (value >= 0x40000000u) {
+    return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
   }
-  return kOtherNumber;
+  return kUnsignedSmall;
 }


Index: src/types.h
diff --git a/src/types.h b/src/types.h
index 98b9e014c7988bb4c0f6f3db34d21fe4389698bc..f141712bb84f09c5e58124174517eadc7a2241f6 100644
--- a/src/types.h
+++ b/src/types.h
@@ -7,12 +7,11 @@

 #include "src/factory.h"
 #include "src/handles.h"
+#include "src/ostreams.h"

 namespace v8 {
 namespace internal {

-class OStream;
-
 // SUMMARY
 //
 // A simple type system for compiler-internal use. It is based entirely on
@@ -512,6 +511,8 @@ class TypeImpl<Config>::BitsetType : public TypeImpl<Config> {
   static int Lub(TypeImpl* type);  // least upper bound that's a bitset
   static int Lub(i::Object* value);
   static int Lub(double value);
+  static int Lub(int32_t value);
+  static int Lub(uint32_t value);
   static int Lub(i::Map* map);
   static int InherentLub(TypeImpl* type);



--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to