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

Unified Diff: include/v8.h

Issue 351573002: Make Object::IsFoo const. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | src/api.h » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index bc2ea0bb0af5e11e048280667909143dfba2a006..bb47cf6836a27c1d32e597ebbbf878058afc4bc1 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -6196,7 +6196,7 @@ Local<String> String::Empty(Isolate* isolate) {
String::ExternalStringResource* String::GetExternalStringResource() const {
typedef internal::Object O;
typedef internal::Internals I;
- O* obj = *reinterpret_cast<O**>(const_cast<String*>(this));
+ O* obj = *reinterpret_cast<O* const*>(this);
String::ExternalStringResource* result;
if (I::IsExternalTwoByteString(I::GetInstanceType(obj))) {
void* value = I::ReadField<void*>(obj, I::kStringResourceOffset);
@@ -6215,7 +6215,7 @@ String::ExternalStringResourceBase* String::GetExternalStringResourceBase(
String::Encoding* encoding_out) const {
typedef internal::Object O;
typedef internal::Internals I;
- O* obj = *reinterpret_cast<O**>(const_cast<String*>(this));
+ O* obj = *reinterpret_cast<O* const*>(this);
int type = I::GetInstanceType(obj) & I::kFullStringRepresentationMask;
*encoding_out = static_cast<Encoding>(type & I::kStringEncodingMask);
ExternalStringResourceBase* resource = NULL;
@@ -6242,7 +6242,7 @@ bool Value::IsUndefined() const {
bool Value::QuickIsUndefined() const {
typedef internal::Object O;
typedef internal::Internals I;
- O* obj = *reinterpret_cast<O**>(const_cast<Value*>(this));
+ O* obj = *reinterpret_cast<O* const*>(this);
if (!I::HasHeapObjectTag(obj)) return false;
if (I::GetInstanceType(obj) != I::kOddballType) return false;
return (I::GetOddballKind(obj) == I::kUndefinedOddballKind);
@@ -6260,7 +6260,7 @@ bool Value::IsNull() const {
bool Value::QuickIsNull() const {
typedef internal::Object O;
typedef internal::Internals I;
- O* obj = *reinterpret_cast<O**>(const_cast<Value*>(this));
+ O* obj = *reinterpret_cast<O* const*>(this);
if (!I::HasHeapObjectTag(obj)) return false;
if (I::GetInstanceType(obj) != I::kOddballType) return false;
return (I::GetOddballKind(obj) == I::kNullOddballKind);
@@ -6278,7 +6278,7 @@ bool Value::IsString() const {
bool Value::QuickIsString() const {
typedef internal::Object O;
typedef internal::Internals I;
- O* obj = *reinterpret_cast<O**>(const_cast<Value*>(this));
+ O* obj = *reinterpret_cast<O* const*>(this);
if (!I::HasHeapObjectTag(obj)) return false;
return (I::GetInstanceType(obj) < I::kFirstNonstringType);
}
« no previous file with comments | « no previous file | src/api.h » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698