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

Unified Diff: src/api.cc

Issue 1337993005: [runtime] Replace the EQUALS builtin with proper Object::Equals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address Michi's nit. Created 5 years, 3 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/arm/code-stubs-arm.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 8cceb65a27a563bb04837c64d61765bba1610460..1b5d428a3c74d657a90f3c6a072e1e5e0cd2ea77 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -3365,21 +3365,7 @@ Local<Uint32> Value::ToArrayIndex() const {
Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
auto self = Utils::OpenHandle(this);
auto other = Utils::OpenHandle(*that);
- if (self->IsSmi() && other->IsSmi()) {
- return Just(self->Number() == other->Number());
- }
- if (self->IsJSObject() && other->IsJSObject()) {
- return Just(*self == *other);
- }
- PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Value::Equals()", bool);
- i::Handle<i::Object> args[] = { other };
- i::Handle<i::JSFunction> fun = isolate->equals_builtin();
- i::Handle<i::Object> result;
- has_pending_exception =
- !i::Execution::Call(isolate, fun, self, arraysize(args), args)
- .ToHandle(&result);
- RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
- return Just(*result == i::Smi::FromInt(i::EQUAL));
+ return i::Object::Equals(self, other);
}
« no previous file with comments | « no previous file | src/arm/code-stubs-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698