From: kasperl@chromium.org Date: Wed, 29 Jul 2009 09:51:41 +0000 (+0000) Subject: Change the check for builtin functions to not be based on identity, X-Git-Tag: upstream/4.7.83~23557 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84d8e51df4023a0df8981f2f967154aa730b7968;p=platform%2Fupstream%2Fv8.git Change the check for builtin functions to not be based on identity, which seems shaky in the presence of multiple builtin objects. Review URL: http://codereview.chromium.org/159583 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2573 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/debug.cc b/src/debug.cc index be18cbf..18536f5 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1301,7 +1301,7 @@ void Debug::HandleStepIn(Handle function, // step into was requested. if (fp == Debug::step_in_fp()) { // Don't allow step into functions in the native context. - if (function->context()->global() != Top::context()->builtins()) { + if (!function->IsBuiltin()) { if (function->shared()->code() == Builtins::builtin(Builtins::FunctionApply) || function->shared()->code() == @@ -1311,8 +1311,7 @@ void Debug::HandleStepIn(Handle function, // Builtins::FunctionCall. The receiver of call/apply is the target // function. if (!holder.is_null() && holder->IsJSFunction() && - JSFunction::cast(*holder)->context()->global() != - Top::context()->builtins()) { + !JSFunction::cast(*holder)->IsBuiltin()) { Handle shared_info( JSFunction::cast(*holder)->shared()); Debug::FloodWithOneShot(shared_info); diff --git a/src/objects-inl.h b/src/objects-inl.h index 0b5e073..b000dcf 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -2341,6 +2341,11 @@ bool JSFunction::IsBoilerplate() { } +bool JSFunction::IsBuiltin() { + return context()->global()->IsJSBuiltinsObject(); +} + + bool JSObject::IsLoaded() { return !map()->needs_loading(); } diff --git a/src/objects.h b/src/objects.h index 64e6b36..7c30517 100644 --- a/src/objects.h +++ b/src/objects.h @@ -3175,6 +3175,9 @@ class JSFunction: public JSObject { // function. inline bool IsBoilerplate(); + // Tells whether this function is builtin. + inline bool IsBuiltin(); + // [literals]: Fixed array holding the materialized literals. // // If the function contains object, regexp or array literals, the