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

Unified Diff: src/objects-inl.h

Issue 3031005: [Isolates] Avoid dereferencing Isolate::Current() to check oddball identities... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 10 years, 4 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-debug.cc ('k') | src/prettyprinter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h (revision 5190)
+++ src/objects-inl.h (working copy)
@@ -522,7 +522,8 @@
bool Object::IsBoolean() {
- return IsTrue() || IsFalse();
+ return IsOddball() &&
+ ((Oddball::cast(this)->kind() & Oddball::kNotBooleanMask) == 0);
}
@@ -660,27 +661,27 @@
bool Object::IsUndefined() {
- return this == HEAP->undefined_value();
+ return IsOddball() && Oddball::cast(this)->kind() == Oddball::kUndefined;
}
bool Object::IsTheHole() {
- return this == HEAP->the_hole_value();
+ return IsOddball() && Oddball::cast(this)->kind() == Oddball::kTheHole;
}
bool Object::IsNull() {
- return this == HEAP->null_value();
+ return IsOddball() && Oddball::cast(this)->kind() == Oddball::kNull;
}
bool Object::IsTrue() {
- return this == HEAP->true_value();
+ return IsOddball() && Oddball::cast(this)->kind() == Oddball::kTrue;
}
bool Object::IsFalse() {
- return this == HEAP->false_value();
+ return IsOddball() && Oddball::cast(this)->kind() == Oddball::kFalse;
}
@@ -692,7 +693,6 @@
}
-
Object* Object::ToSmi() {
if (IsSmi()) return this;
if (IsHeapNumber()) {
@@ -1203,6 +1203,16 @@
ACCESSORS(Oddball, to_number, Object, kToNumberOffset)
+byte Oddball::kind() {
+ return READ_BYTE_FIELD(this, kKindOffset);
+}
+
+
+void Oddball::set_kind(byte value) {
+ WRITE_BYTE_FIELD(this, kKindOffset, value);
+}
+
+
Object* JSGlobalPropertyCell::value() {
return READ_FIELD(this, kValueOffset);
}
@@ -2715,7 +2725,7 @@
void JSFunction::set_context(Object* value) {
- ASSERT(value == HEAP->undefined_value() || value->IsContext());
+ ASSERT(value->IsUndefined() || value->IsContext());
WRITE_FIELD(this, kContextOffset, value);
WRITE_BARRIER(this, kContextOffset);
}
« no previous file with comments | « src/objects-debug.cc ('k') | src/prettyprinter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698