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

Unified Diff: src/api.cc

Issue 67613005: Move template instance check from Object to FunctionTemplateInfo::IsTemplateFor (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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/bootstrapper.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 736f0b00d7ac833ca3409ebd703a90f8ef49a5bc..5d954ef8c4a0493901ea8cd852c2a2c23242514f 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1264,7 +1264,7 @@ int TypeSwitch::match(v8::Handle<Value> value) {
i::Handle<i::TypeSwitchInfo> info = Utils::OpenHandle(this);
i::FixedArray* types = i::FixedArray::cast(info->types());
for (int i = 0; i < types->length(); i++) {
- if (obj->IsInstanceOf(i::FunctionTemplateInfo::cast(types->get(i))))
+ if (i::FunctionTemplateInfo::cast(types->get(i))->IsTemplateFor(*obj))
return i + 1;
}
return 0;
@@ -3346,7 +3346,7 @@ Local<Object> v8::Object::FindInstanceInPrototypeChain(
ENTER_V8(isolate);
i::JSObject* object = *Utils::OpenHandle(this);
i::FunctionTemplateInfo* tmpl_info = *Utils::OpenHandle(*tmpl);
- while (!object->IsInstanceOf(tmpl_info)) {
+ while (!tmpl_info->IsTemplateFor(object)) {
i::Object* prototype = object->GetPrototype();
if (!prototype->IsJSObject()) return Local<Object>();
object = i::JSObject::cast(prototype);
@@ -5427,7 +5427,7 @@ bool FunctionTemplate::HasInstance(v8::Handle<v8::Value> value) {
ON_BAILOUT(i::Isolate::Current(), "v8::FunctionTemplate::HasInstanceOf()",
return false);
i::Object* obj = *Utils::OpenHandle(*value);
- return obj->IsInstanceOf(*Utils::OpenHandle(this));
+ return Utils::OpenHandle(this)->IsTemplateFor(obj);
}
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698