Revision: 11348
Author:   [email protected]
Date:     Tue Apr 17 03:42:17 2012
Log:      Fix a bug in heap profile tracing of closures.

The heap profile tracers assumed that a closure always closed over a
function context.  This is obviously not true (e.g., function expressions
nested inside catch or with).  This assumption could lead to using a
function's scope info to interpret a catch or with context.

[email protected]
BUG=v8:2078
TEST=

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

Modified:
 /branches/bleeding_edge/src/profile-generator.cc

=======================================
--- /branches/bleeding_edge/src/profile-generator.cc Mon Apr 16 08:36:19 2012 +++ /branches/bleeding_edge/src/profile-generator.cc Tue Apr 17 03:42:17 2012
@@ -2157,7 +2157,7 @@
   if (!js_obj->IsJSFunction()) return;

   JSFunction* func = JSFunction::cast(js_obj);
-  Context* context = func->context();
+  Context* context = func->context()->declaration_context();
   ScopeInfo* scope_info = context->closure()->shared()->scope_info();

   if (func->shared()->bound()) {

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

Reply via email to