Reviewers: Yury Semikhatsky, Søren Gjesse,

Description:
Change the check for builtin functions to not be based on identity,
which seems shaky in the presence of multiple builtin objects.

Please review this at http://codereview.chromium.org/159583

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
   M     src/debug.cc
   M     src/objects-inl.h
   M     src/objects.h


Index: src/objects.h
===================================================================
--- src/objects.h       (revision 2572)
+++ src/objects.h       (working copy)
@@ -3175,6 +3175,9 @@
    // 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
Index: src/debug.cc
===================================================================
--- src/debug.cc        (revision 2572)
+++ src/debug.cc        (working copy)
@@ -1301,7 +1301,7 @@
    // 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 @@
          // 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<SharedFunctionInfo> shared_info(
                JSFunction::cast(*holder)->shared());
            Debug::FloodWithOneShot(shared_info);
Index: src/objects-inl.h
===================================================================
--- src/objects-inl.h   (revision 2572)
+++ src/objects-inl.h   (working copy)
@@ -2341,6 +2341,11 @@
  }


+bool JSFunction::IsBuiltin() {
+  return context()->global()->IsJSBuiltinsObject();
+}
+
+
  bool JSObject::IsLoaded() {
    return !map()->needs_loading();
  }



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to