Revision: 2573
Author: [email protected]
Date: Wed Jul 29 02:51:41 2009
Log: 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
http://code.google.com/p/v8/source/detail?r=2573

Modified:
  /branches/bleeding_edge/src/debug.cc
  /branches/bleeding_edge/src/objects-inl.h
  /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/debug.cc        Tue Jul 28 23:34:30 2009
+++ /branches/bleeding_edge/src/debug.cc        Wed Jul 29 02:51:41 2009
@@ -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);
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Tue Jul 28 01:43:51 2009
+++ /branches/bleeding_edge/src/objects-inl.h   Wed Jul 29 02:51:41 2009
@@ -2339,6 +2339,11 @@
  bool JSFunction::IsBoilerplate() {
    return map() == Heap::boilerplate_function_map();
  }
+
+
+bool JSFunction::IsBuiltin() {
+  return context()->global()->IsJSBuiltinsObject();
+}


  bool JSObject::IsLoaded() {
=======================================
--- /branches/bleeding_edge/src/objects.h       Tue Jul 28 07:46:06 2009
+++ /branches/bleeding_edge/src/objects.h       Wed Jul 29 02:51:41 2009
@@ -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

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

Reply via email to