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

Unified Diff: src/api.cc

Issue 16729002: build fix for 15023 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3c1a003809bbb4efd0021c1bc8c45e5144b5a051..2deab773bfdf420c1128a6a3051a985f529d8085 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4303,6 +4303,23 @@ bool String::IsOneByte() const {
return str->HasOnlyOneByteChars();
}
+// Helpers for ContainsOnlyOneByteHelper
+template<size_t size> struct OneByteMask;
+template<> struct OneByteMask<4> {
+ static const uint32_t value = 0xFF00FF00;
+};
+template<> struct OneByteMask<8> {
+ static const uint64_t value = 0xFF00FF00FF00FF00;
+};
+static const uintptr_t kOneByteMask = OneByteMask<sizeof(uintptr_t)>::value;
+static const uintptr_t kAlignmentMask = sizeof(uintptr_t) - 1;
+static inline bool Unaligned(const uint16_t* chars) {
+ return reinterpret_cast<const uintptr_t>(chars) & kAlignmentMask;
+}
+static inline const uint16_t* Align(const uint16_t* chars) {
+ return reinterpret_cast<uint16_t*>(
+ reinterpret_cast<uintptr_t>(chars) & ~kAlignmentMask);
+}
class ContainsOnlyOneByteHelper {
public:
@@ -4348,16 +4365,6 @@ class ContainsOnlyOneByteHelper {
}
private:
- static const uintptr_t kOneByteMask =
- static_cast<uintptr_t>(0xFF00FF00FF00FF00ULL);
- static const uintptr_t kAlignmentMask = sizeof(uintptr_t) - 1;
- static inline bool Unaligned(const uint16_t* chars) {
- return reinterpret_cast<const uintptr_t>(chars) & kAlignmentMask;
- }
- static inline const uint16_t* Align(const uint16_t* chars) {
- return reinterpret_cast<uint16_t*>(
- reinterpret_cast<uintptr_t>(chars) & ~kAlignmentMask);
- }
bool CheckCons(i::ConsString* cons_string) {
while (true) {
// Check left side if flat.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698