BUG=148757
TEST=largeObj test from the bug is 2x faster.
R=yangguo@chromium.org
Review URL: https://chromiumcodereview.appspot.com/
11377100
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12938
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
static bool CheckConstructor(i::Isolate* isolate,
i::Handle<i::JSObject> obj,
const char* class_name) {
- return obj->map()->constructor() == LookupBuiltin(isolate, class_name);
+ i::Object* constr = obj->map()->constructor();
+ if (!constr->IsJSFunction()) return false;
+ i::JSFunction* func = i::JSFunction::cast(constr);
+ return func->shared()->native() &&
+ constr == LookupBuiltin(isolate, class_name);
}