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

Unified Diff: src/objects.h

Issue 8143018: Revert "Added ability to lock strings to prevent their representation or encoding from changing." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/json-parser.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 74fb01257954d77788f4e3cfa2bf16d478b0f1fa..7e531b28ae38ebbb5092934e196f483384cfddaf 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5766,6 +5766,7 @@ class StringHasher {
uint32_t raw_running_hash_;
uint32_t array_index_;
bool is_array_index_;
+ bool is_first_char_;
bool is_valid_;
friend class TwoCharHashTableKey;
};
@@ -6217,25 +6218,15 @@ class SeqString: public String {
// Layout description.
static const int kHeaderSize = String::kSize;
- // Shortcuts for templates that know their string-type exactly.
- bool IsExternalAsciiString() {
- return false;
- }
- bool IsExternalTwoByteString() {
- return false;
- }
-
-
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(SeqString);
};
-// The SeqAsciiString class captures sequential ASCII string objects.
-// Each character in the AsciiString is an ASCII character.
+// The AsciiString class captures sequential ascii string objects.
+// Each character in the AsciiString is an ascii character.
class SeqAsciiString: public SeqString {
public:
- typedef char CharType;
static const bool kHasAsciiEncoding = true;
// Dispatched behavior.
@@ -6250,15 +6241,6 @@ class SeqAsciiString: public SeqString {
// Casting
static inline SeqAsciiString* cast(Object* obj);
- bool IsSeqAsciiString() {
- ASSERT(this->Object::IsSeqAsciiString());
- return true;
- }
- bool IsSeqTwoByteString() {
- ASSERT(this->Object::IsSeqAsciiString());
- return false;
- }
-
// Garbage collection support. This method is called by the
// garbage collector to compute the actual size of an AsciiString
// instance.
@@ -6288,12 +6270,10 @@ class SeqAsciiString: public SeqString {
};
-// The SeqTwoByteString class captures sequential unicode string objects.
+// The TwoByteString class captures sequential unicode string objects.
// Each character in the TwoByteString is a two-byte uint16_t.
class SeqTwoByteString: public SeqString {
public:
- typedef uc16 CharType;
-
static const bool kHasAsciiEncoding = false;
// Dispatched behavior.
@@ -6310,14 +6290,6 @@ class SeqTwoByteString: public SeqString {
// Casting
static inline SeqTwoByteString* cast(Object* obj);
- bool IsSeqTwoByteString() {
- ASSERT(this->Object::IsSeqTwoByteString());
- return true;
- }
- bool IsSeqAsciiString() {
- ASSERT(this->Object::IsSeqTwoByteString());
- return false;
- }
// Garbage collection support. This method is called by the
// garbage collector to compute the actual size of a TwoByteString
@@ -6478,14 +6450,6 @@ class ExternalString: public String {
STATIC_CHECK(kResourceOffset == Internals::kStringResourceOffset);
- // Shortcuts for templates that know their string type exactly.
- bool IsSeqAsciiString() {
- return false;
- }
- bool IsSeqTwoByteString() {
- return false;
- }
-
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalString);
};
@@ -6495,8 +6459,6 @@ class ExternalString: public String {
// ASCII string.
class ExternalAsciiString: public ExternalString {
public:
- typedef char CharType;
-
static const bool kHasAsciiEncoding = true;
typedef v8::String::ExternalAsciiStringResource Resource;
@@ -6510,14 +6472,6 @@ class ExternalAsciiString: public ExternalString {
// Casting.
static inline ExternalAsciiString* cast(Object* obj);
- bool IsExternalAsciiString() {
- ASSERT(this->Object::IsExternalAsciiString());
- return true;
- }
- bool IsExternalTwoByteString() {
- ASSERT(this->Object::IsExternalAsciiString());
- return false;
- }
// Garbage collection support.
inline void ExternalAsciiStringIterateBody(ObjectVisitor* v);
@@ -6538,11 +6492,10 @@ class ExternalAsciiString: public ExternalString {
};
-// The ExternalTwoByteString class is an external string backed by a 16-bit
-// character sequence.
+// The ExternalTwoByteString class is an external string backed by a UTF-16
+// encoded string.
class ExternalTwoByteString: public ExternalString {
public:
- typedef uc16 CharType;
static const bool kHasAsciiEncoding = false;
typedef v8::String::ExternalStringResource Resource;
@@ -6559,14 +6512,6 @@ class ExternalTwoByteString: public ExternalString {
// Casting.
static inline ExternalTwoByteString* cast(Object* obj);
- bool IsExternalTwoByteString() {
- ASSERT(this->Object::IsExternalTwoByteString());
- return true;
- }
- bool IsExternalAsciiString() {
- ASSERT(this->Object::IsExternalTwoByteString());
- return false;
- }
// Garbage collection support.
inline void ExternalTwoByteStringIterateBody(ObjectVisitor* v);
« no previous file with comments | « src/json-parser.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698