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

Unified Diff: src/objects.h

Issue 8513010: Add pointer cache field to external string for access in generated code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 9 years, 1 month 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 6e672e734aa008662cebe039d63c0c2da355f3c6..343888dd82d7b22552f397be305072a82cd628ec 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6758,7 +6758,12 @@ class ExternalString: public String {
// Layout description.
static const int kResourceOffset = POINTER_SIZE_ALIGN(String::kSize);
- static const int kSize = kResourceOffset + kPointerSize;
+ static const int kResourceDataOffset = kResourceOffset + kPointerSize;
+ static const int kSize = kResourceDataOffset + kPointerSize;
+
+ // Clear the cached pointer to the character array provided by the resource.
+ // This cache is updated the first time the character array is accessed.
+ inline void clear_data_cache();
STATIC_CHECK(kResourceOffset == Internals::kStringResourceOffset);
@@ -6779,6 +6784,8 @@ class ExternalAsciiString: public ExternalString {
inline const Resource* resource();
inline void set_resource(const Resource* buffer);
+ inline const char* GetChars();
+
// Dispatched behavior.
uint16_t ExternalAsciiStringGet(int index);
@@ -6816,6 +6823,8 @@ class ExternalTwoByteString: public ExternalString {
inline const Resource* resource();
inline void set_resource(const Resource* buffer);
+ inline const uint16_t* GetChars();
+
// Dispatched behavior.
uint16_t ExternalTwoByteStringGet(int index);

Powered by Google App Engine
This is Rietveld 408576698