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

Unified Diff: src/api.cc

Issue 2060213002: Revert of Replace all remaining Oddball checks with new function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/api.h ('k') | src/api-natives.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index f460b5ec041b59c131de48b62ef09d1c4815053b..62160ddd0cbd14ca80e5dffb04f15e23554cd098 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2603,7 +2603,7 @@
i::Handle<i::JSObject> self = Utils::OpenHandle(f);
i::Handle<i::Object> obj =
i::JSReceiver::GetProperty(isolate, self, propertyName).ToHandleChecked();
- return obj->IsTrue(isolate);
+ return obj->IsTrue();
}
bool StackFrame::IsEval() const { return getBoolProperty(this, "isEval"); }
@@ -2771,38 +2771,26 @@
// --- D a t a ---
bool Value::FullIsUndefined() const {
- i::Handle<i::Object> object = Utils::OpenHandle(this);
- bool result = false;
- if (!object->IsSmi()) {
- result = object->IsUndefined(i::HeapObject::cast(*object)->GetIsolate());
- }
+ bool result = Utils::OpenHandle(this)->IsUndefined();
DCHECK_EQ(result, QuickIsUndefined());
return result;
}
bool Value::FullIsNull() const {
- i::Handle<i::Object> object = Utils::OpenHandle(this);
- bool result = false;
- if (!object->IsSmi()) {
- result = object->IsNull(i::HeapObject::cast(*object)->GetIsolate());
- }
+ bool result = Utils::OpenHandle(this)->IsNull();
DCHECK_EQ(result, QuickIsNull());
return result;
}
bool Value::IsTrue() const {
- i::Handle<i::Object> object = Utils::OpenHandle(this);
- if (object->IsSmi()) return false;
- return object->IsTrue(i::HeapObject::cast(*object)->GetIsolate());
+ return Utils::OpenHandle(this)->IsTrue();
}
bool Value::IsFalse() const {
- i::Handle<i::Object> object = Utils::OpenHandle(this);
- if (object->IsSmi()) return false;
- return object->IsFalse(i::HeapObject::cast(*object)->GetIsolate());
+ return Utils::OpenHandle(this)->IsFalse();
}
@@ -4051,7 +4039,7 @@
has_pending_exception =
!i::JSObject::SetAccessor(obj, info).ToHandle(&result);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
- if (result->IsUndefined(obj->GetIsolate())) return Nothing<bool>();
+ if (result->IsUndefined()) return Nothing<bool>();
if (fast) {
i::JSObject::MigrateSlowToFast(obj, 0, "APISetAccessor");
}
@@ -5341,7 +5329,7 @@
bool Boolean::Value() const {
i::Handle<i::Object> obj = Utils::OpenHandle(this);
- return obj->IsTrue(i::HeapObject::cast(*obj)->GetIsolate());
+ return obj->IsTrue();
}
@@ -5432,10 +5420,7 @@
static void* ExternalValue(i::Object* obj) {
// Obscure semantics for undefined, but somehow checked in our unit tests...
- if (!obj->IsSmi() &&
- obj->IsUndefined(i::HeapObject::cast(obj)->GetIsolate())) {
- return NULL;
- }
+ if (obj->IsUndefined()) return NULL;
i::Object* foreign = i::JSObject::cast(obj)->GetInternalField(0);
return i::Foreign::cast(foreign)->foreign_address();
}
@@ -5688,8 +5673,7 @@
bool Context::IsCodeGenerationFromStringsAllowed() {
i::Handle<i::Context> context = Utils::OpenHandle(this);
- return !context->allow_code_gen_from_strings()->IsFalse(
- context->GetIsolate());
+ return !context->allow_code_gen_from_strings()->IsFalse();
}
@@ -6073,7 +6057,7 @@
i::Handle<i::JSValue> jsvalue = i::Handle<i::JSValue>::cast(obj);
i::Isolate* isolate = jsvalue->GetIsolate();
LOG_API(isolate, BooleanObject, BooleanValue);
- return jsvalue->value()->IsTrue(isolate);
+ return jsvalue->value()->IsTrue();
}
@@ -6320,7 +6304,7 @@
arraysize(argv), argv)
.ToHandle(&result);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
- return Just(result->IsTrue(isolate));
+ return Just(result->IsTrue());
}
@@ -6333,7 +6317,7 @@
self, arraysize(argv), argv)
.ToHandle(&result);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
- return Just(result->IsTrue(isolate));
+ return Just(result->IsTrue());
}
@@ -6412,7 +6396,7 @@
arraysize(argv), argv)
.ToHandle(&result);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
- return Just(result->IsTrue(isolate));
+ return Just(result->IsTrue());
}
@@ -6425,7 +6409,7 @@
self, arraysize(argv), argv)
.ToHandle(&result);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
- return Just(result->IsTrue(isolate));
+ return Just(result->IsTrue());
}
@@ -6599,7 +6583,7 @@
LOG_API(isolate, Promise, HasRejectHandler);
ENTER_V8(isolate);
i::Handle<i::Symbol> key = isolate->factory()->promise_has_handler_symbol();
- return i::JSReceiver::GetDataProperty(promise, key)->IsTrue(isolate);
+ return i::JSReceiver::GetDataProperty(promise, key)->IsTrue();
}
« no previous file with comments | « src/api.h ('k') | src/api-natives.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698