[v8] r12938 committed - Speed up native error check....

2 views
Skip to first unread message

codesite...@google.com

unread,
Nov 12, 2012, 10:33:51 AM11/12/12
to v8-...@googlegroups.com
Revision: 12938
Author: ul...@chromium.org
Date: Mon Nov 12 07:33:31 2012
Log: Speed up native error check.

BUG=148757
TEST=largeObj test from the bug is 2x faster.
R=yan...@chromium.org

Review URL: https://chromiumcodereview.appspot.com/11377100
http://code.google.com/p/v8/source/detail?r=12938

Modified:
/branches/bleeding_edge/src/api.cc

=======================================
--- /branches/bleeding_edge/src/api.cc Mon Nov 12 04:34:18 2012
+++ /branches/bleeding_edge/src/api.cc Mon Nov 12 07:33:31 2012
@@ -2309,7 +2309,11 @@
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);
}


Reply all
Reply to author
Forward
0 new messages