Last Comment Bug 654734 - TrampolineCompiler::generateForceReturn should emit a call to ScriptDebugEpilogue
: TrampolineCompiler::generateForceReturn should emit a call to ScriptDebugEpil...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Other Branch
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: jsd
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-04 09:10 PDT by Jason Orendorff [:jorendorff]
Modified: 2011-08-23 06:58 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (landed in jsdbg2) (2.05 KB, patch)
2011-05-04 09:10 PDT, Jason Orendorff [:jorendorff]
dvander: review+
Details | Diff | Review

Description Jason Orendorff [:jorendorff] 2011-05-04 09:10:18 PDT
Created attachment 530035 [details] [diff] [review]
v1 (landed in jsdbg2)

The comment says:

/*
 * This is shamelessly copied from emitReturn, but with several changes:
 * - There was always at least one inline call.
 * - We don't know if there is a call object, so we always check.
 * - We don't know where we came from, so we don't know frame depth or PC.
 * - There is no stub buffer.
 */

emitReturn emits a call to stubs::ScriptDebugEpilogue in debug mode.

The trampoline generated by generateForceReturn can only be called in debug mode, so it should unconditionally emit a call to ScriptDebugEpilogue.

This patch applies on top of
  http://hg.mozilla.org/users/jblandy_mozilla.com/jsdbg2
revision 37b0503c5603.

Please take a look. I have no reason to believe this patch is safe. In particular I'm casting to void* without knowing anything about the types and calling conventions. (Also, ScriptDebugEpilogue can execute arbitrary JS code, due to debugging hooks; but if emitReturn does it I think it's probably safe to do it here too.)
Comment 1 David Anderson [:dvander] 2011-05-09 23:55:42 PDT
Yeah, this is safe, the calling convention for fallible vm calls is fastcall (VMFrame &), the return value can be anything and there can be one additional parameter. The VMFrame is passed implicitly.
Comment 2 Jason Orendorff [:jorendorff] 2011-08-23 06:58:27 PDT
http://hg.mozilla.org/mozilla-central/rev/5fd40e7a5faf

Note You need to log in before you can comment on or make changes to this bug.