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

Unified Diff: src/types.cc

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback, rebase and "git cl format" Created 6 years, 5 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/types.h ('k') | src/typing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index 327eba0679bc9cb9efa5444a839ef02b8b8082e3..0f39e51b822b188b0704b7d79dfe9f6f05ccdf10 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -4,7 +4,7 @@
#include "src/types.h"
-#include "src/string-stream.h"
+#include "src/ostreams.h"
#include "src/types-inl.h"
namespace v8 {
@@ -123,31 +123,21 @@ 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)) 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 (IsUint32Double(value)) {
+ uint32_t u = FastD2UI(value);
+ if (u < 0x40000000u) return kUnsignedSmall;
+ if (u < 0x80000000u) {
+ return i::SmiValuesAre31Bits() ? kOtherUnsigned31 : kUnsignedSmall;
+ }
+ return kOtherUnsigned32;
}
- 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;
+ if (IsInt32Double(value)) {
+ int32_t i = FastD2I(value);
+ ASSERT(i < 0);
+ if (i >= -0x40000000) return kOtherSignedSmall;
+ return i::SmiValuesAre31Bits() ? kOtherSigned32 : kOtherSignedSmall;
}
- return kUnsignedSmall;
+ return kOtherNumber;
}
@@ -238,6 +228,7 @@ int TypeImpl<Config>::BitsetType::Lub(i::Map* map) {
case ACCESSOR_PAIR_TYPE:
case FIXED_ARRAY_TYPE:
case FOREIGN_TYPE:
+ case CODE_TYPE:
return kInternal & kTaggedPtr;
default:
UNREACHABLE();
« no previous file with comments | « src/types.h ('k') | src/typing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698