Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: src/debug.cc

Issue 63055: Fixed the step in handling for function.apply (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.cc
===================================================================
--- src/debug.cc (revision 1682)
+++ src/debug.cc (working copy)
@@ -1160,7 +1160,28 @@
if (fp == Debug::step_in_fp()) {
// Don't allow step into functions in the native context.
if (function->context()->global() != Top::context()->builtins()) {
- Debug::FloodWithOneShot(Handle<SharedFunctionInfo>(function->shared()));
+ if (function->shared()->code() ==
+ Builtins::builtin(Builtins::FunctionApply)) {
+ // Handle function.apply separately to flood the function to be called
+ // and not the code for Builtins::FunctionApply. At the point of the
+ // call IC to call Builtins::FunctionApply the expression stack has the
+ // following content:
+ // symbol "apply"
+ // function apply was called on
+ // receiver for apply (first parameter to apply)
+ // arguments array for apply (second parameter to apply)
+ JavaScriptFrameIterator it;
+ ASSERT(it.frame()->fp() == fp);
+ ASSERT(it.frame()->GetExpression(1)->IsJSFunction());
+ if (it.frame()->GetExpression(1)->IsJSFunction()) {
+ Handle<JSFunction>
+ actual_function(JSFunction::cast(it.frame()->GetExpression(1)));
+ Handle<SharedFunctionInfo> actual_shared(actual_function->shared());
+ Debug::FloodWithOneShot(actual_shared);
+ }
+ } else {
+ Debug::FloodWithOneShot(Handle<SharedFunctionInfo>(function->shared()));
+ }
}
}
}
« no previous file with comments | « no previous file | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698