Ignore:
Timestamp:
Jul 18, 2012, 4:26:06 PM (13 years ago)
Author:
[email protected]
Message:

dumpCallFrame is broken in ToT
https://bugs.webkit.org/show_bug.cgi?id=91444

Reviewed by Gavin Barraclough.

Various changes have been made to the SF calling convention, but
dumpCallFrame has not been updated to reflect these changes.
That resulted in both bogus information, as well as numerous
assertions of sadness.

This patch makes dumpCallFrame actually work again and adds the
wonderful feature of telling you the name of the variable that a
register reflects, or what value it contains.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::nameForRegister):

A really innefficient mechanism for finding the name of a local register.
This should only ever be used by debug code so this should be okay.

  • bytecode/CodeBlock.h:

(CodeBlock):

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::generate):

Debug builds no longer throw away a functions symbol table, this allows
us to actually perform a register# to name mapping

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::link):

We weren't propogating the bytecode offset here leading to assertions
in debug builds when dumping bytecode of DFG compiled code.

  • interpreter/Interpreter.cpp:

(JSC):
(JSC::Interpreter::dumpRegisters):

Rework to actually be correct.

(JSC::getCallerInfo):

Return the byteocde offset as well now, given we have to determine it
anyway.

(JSC::Interpreter::getStackTrace):
(JSC::Interpreter::retrieveCallerFromVMCode):

  • interpreter/Interpreter.h:

(Interpreter):

  • jsc.cpp:

(GlobalObject::finishCreation):
(functionDumpCallFrame):

Give debug builds of JSC a method for calling dumpCallFrame so we can
inspect a callframe without requiring us to break in a debugger.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.h

    r122795 r123042  
    249249        void startSampling();
    250250        void stopSampling();
     251
     252        JS_EXPORT_PRIVATE void dumpCallFrame(CallFrame*);
     253
    251254    private:
    252255        enum ExecutionFlag { Normal, InitializeAndReturn };
     
    280283        JSValue privateExecute(ExecutionFlag, RegisterFile*, CallFrame*);
    281284
    282         void dumpCallFrame(CallFrame*);
    283285        void dumpRegisters(CallFrame*);
    284286       
Note: See TracChangeset for help on using the changeset viewer.