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

Unified Diff: src/objects-inl.h

Issue 1149563011: Verify a bit more about external strings (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 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 | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 39646cd4b5e47cc2419c9fbb0a556c209dcc1440..6fb74caf97f8a84d556807c4b34d933f16e1e3e3 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3468,14 +3468,21 @@ void ConsString::set_second(String* value, WriteBarrierMode mode) {
}
+const void* ExternalString::resource_data() const {
+ return *reinterpret_cast<const void* const*>(
+ FIELD_ADDR_CONST(this, kResourceDataOffset));
+}
+
+
bool ExternalString::is_short() {
InstanceType type = map()->instance_type();
return (type & kShortExternalStringMask) == kShortExternalStringTag;
}
-const ExternalOneByteString::Resource* ExternalOneByteString::resource() {
- return *reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset));
+const ExternalOneByteString::Resource* ExternalOneByteString::resource() const {
+ return *reinterpret_cast<const Resource* const*>(
+ FIELD_ADDR_CONST(this, kResourceOffset));
}
@@ -3507,8 +3514,9 @@ uint16_t ExternalOneByteString::ExternalOneByteStringGet(int index) {
}
-const ExternalTwoByteString::Resource* ExternalTwoByteString::resource() {
- return *reinterpret_cast<Resource**>(FIELD_ADDR(this, kResourceOffset));
+const ExternalTwoByteString::Resource* ExternalTwoByteString::resource() const {
+ return *reinterpret_cast<const Resource* const*>(
+ FIELD_ADDR_CONST(this, kResourceOffset));
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698