Index: runtime/vm/unibrow.h |
diff --git a/runtime/vm/unibrow.h b/runtime/vm/unibrow.h |
index d1f287d7f8ed2f471a51bdb1705603f4c9b558a4..82250d2e9e4be0a98c9445c11998b16d13e5ee71 100644 |
--- a/runtime/vm/unibrow.h |
+++ b/runtime/vm/unibrow.h |
@@ -7,7 +7,7 @@ |
#include <sys/types.h> |
-// SNIP |
+#include "vm/globals.h" |
/** |
* \file |
@@ -16,59 +16,55 @@ |
namespace unibrow { |
-// SNIP |
- |
// A cache used in case conversion. It caches the value for characters |
// that either have no mapping or map to a single character independent |
// of context. Characters that map to more than one character or that |
// map differently depending on context are always looked up. |
-template <class T, int size = 256> |
+template <class T, intptr_t size = 256> |
class Mapping { |
public: |
inline Mapping() { } |
- inline int get(uchar c, uchar n, uchar* result); |
+ inline intptr_t get(int32_t c, int32_t n, int32_t* result); |
private: |
friend class Test; |
- int CalculateValue(uchar c, uchar n, uchar* result); |
+ intptr_t CalculateValue(int32_t c, int32_t n, int32_t* result); |
struct CacheEntry { |
inline CacheEntry() : code_point_(kNoChar), offset_(0) { } |
- inline CacheEntry(uchar code_point, signed offset) |
+ inline CacheEntry(int32_t code_point, signed offset) |
: code_point_(code_point), |
offset_(offset) { } |
- uchar code_point_; |
+ int32_t code_point_; |
signed offset_; |
- static const int kNoChar = (1 << 21) - 1; |
+ static const intptr_t kNoChar = (1 << 21) - 1; |
}; |
- static const int kSize = size; |
- static const int kMask = kSize - 1; |
+ static const intptr_t kSize = size; |
+ static const intptr_t kMask = kSize - 1; |
CacheEntry entries_[kSize]; |
}; |
-// SNIP |
- |
struct Letter { |
- static bool Is(uchar c); |
+ static bool Is(int32_t c); |
}; |
struct Ecma262Canonicalize { |
- static const int kMaxWidth = 1; |
- static int Convert(uchar c, |
- uchar n, |
- uchar* result, |
- bool* allow_caching_ptr); |
+ static const intptr_t kMaxWidth = 1; |
+ static intptr_t Convert(int32_t c, |
+ int32_t n, |
+ int32_t* result, |
+ bool* allow_caching_ptr); |
}; |
struct Ecma262UnCanonicalize { |
- static const int kMaxWidth = 4; |
- static int Convert(uchar c, |
- uchar n, |
- uchar* result, |
- bool* allow_caching_ptr); |
+ static const intptr_t kMaxWidth = 4; |
+ static intptr_t Convert(int32_t c, |
+ int32_t n, |
+ int32_t* result, |
+ bool* allow_caching_ptr); |
}; |
struct CanonicalizationRange { |
- static const int kMaxWidth = 1; |
- static int Convert(uchar c, |
- uchar n, |
- uchar* result, |
- bool* allow_caching_ptr); |
+ static const intptr_t kMaxWidth = 1; |
+ static intptr_t Convert(int32_t c, |
+ int32_t n, |
+ int32_t* result, |
+ bool* allow_caching_ptr); |
}; |
} // namespace unibrow |