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

Unified Diff: src/objects.cc

Issue 2084923003: Optimize HandleApiCallHelper and friends (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/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.cc
diff --git a/src/objects.cc b/src/objects.cc
index a5da88a0b3b2e0b5e44b17e0918d17655ea38e09..2c5af76b31dc744d1549974b2b66c6b263e50cc6 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -988,10 +988,8 @@ bool Object::ToInt32(int32_t* value) {
return false;
}
-
-bool FunctionTemplateInfo::IsTemplateFor(Object* object) {
- if (!object->IsHeapObject()) return false;
- return IsTemplateFor(HeapObject::cast(object)->map());
+bool FunctionTemplateInfo::IsTemplateFor(JSObject* object) {
+ return IsTemplateFor(object->map());
}
@@ -1014,26 +1012,6 @@ bool FunctionTemplateInfo::IsTemplateFor(Map* map) {
}
-// TODO(dcarney): CallOptimization duplicates this logic, merge.
-Object* FunctionTemplateInfo::GetCompatibleReceiver(Isolate* isolate,
- Object* receiver) {
- // API calls are only supported with JSObject receivers.
- if (!receiver->IsJSObject()) return isolate->heap()->null_value();
- Object* recv_type = this->signature();
- // No signature, return holder.
- if (recv_type->IsUndefined(isolate)) return receiver;
- FunctionTemplateInfo* signature = FunctionTemplateInfo::cast(recv_type);
- // Check the receiver.
- for (PrototypeIterator iter(isolate, JSObject::cast(receiver),
- kStartAtReceiver,
- PrototypeIterator::END_AT_NON_HIDDEN);
- !iter.IsAtEnd(); iter.Advance()) {
- if (signature->IsTemplateFor(iter.GetCurrent())) return iter.GetCurrent();
- }
- return isolate->heap()->null_value();
-}
-
-
// static
MaybeHandle<JSObject> JSObject::New(Handle<JSFunction> constructor,
Handle<JSReceiver> new_target,
« 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