Ignore:
Timestamp:
Apr 10, 2014, 3:33:59 PM (11 years ago)
Author:
[email protected]
Message:

LLInt interpreter code should be generated as part of one function
https://bugs.webkit.org/show_bug.cgi?id=131205

Reviewed by Mark Lam.

Source/JavaScriptCore:

Changed the generation of llint opcodes so that they are all part of the same
global function, llint_entry. That function is used to fill in an entry point
table that includes each of the opcodes and helpers.

Added appropriate use of new -I option to offline assembler and offset
generator scripts.

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter.cpp:
  • llint/LowLevelInterpreter.h:
  • offlineasm/arm.rb:
  • offlineasm/arm64.rb:
  • offlineasm/asm.rb:
  • offlineasm/ast.rb:
  • offlineasm/backends.rb:
  • offlineasm/cloop.rb:
  • offlineasm/generate_offset_extractor.rb:
  • offlineasm/instructions.rb:
  • offlineasm/parser.rb:
  • offlineasm/registers.rb:
  • offlineasm/self_hash.rb:
  • offlineasm/settings.rb:
  • offlineasm/transform.rb:
  • offlineasm/x86.rb:

Added a new "global" keyword to the offline assembler that denotes a label that
should be exported. Added opcode and operand support to get the absolute
address of a local label using position independent calculations. Updated the
offline assembler to handle included files, both when generating the checksum
as well as including files from other than the local directory via a newly
added -I option. The offline assembler now automatically determines external
functions by keeping track of referenced functions that are defined within the
assembly source. This is used both for choosing the correct macro for external
references as well as generating the needed EXTERN directives for masm.
Updated the generation of the masm only .sym file to be written once at the end
of the offline assembler.

  • assembler/MacroAssemblerCodeRef.h:

(JSC::MacroAssemblerCodePtr::createLLIntCodePtr):
(JSC::MacroAssemblerCodeRef::createLLIntCodeRef):

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):

  • bytecode/GetByIdStatus.cpp:

(JSC::GetByIdStatus::computeFromLLInt):

  • bytecode/Opcode.h:

(JSC::padOpcodeName):

  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::computeFromLLInt):

  • jit/JIT.cpp:

(JSC::JIT::privateCompileMainPass):

  • jit/JITStubs.h:
  • llint/LLIntCLoop.cpp:

(JSC::LLInt::initialize):

  • llint/LLIntData.h:

(JSC::LLInt::getCodeFunctionPtr):
(JSC::LLInt::getOpcode): Deleted.
(JSC::LLInt::getCodePtr): Deleted.

  • llint/LLIntOpcode.h:
  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LLIntThunks.cpp:

(JSC::LLInt::functionForCallEntryThunkGenerator):
(JSC::LLInt::functionForConstructEntryThunkGenerator):
(JSC::LLInt::functionForCallArityCheckThunkGenerator):
(JSC::LLInt::functionForConstructArityCheckThunkGenerator):
(JSC::LLInt::evalEntryThunkGenerator):
(JSC::LLInt::programEntryThunkGenerator):

  • llint/LLIntThunks.h:

Changed references to llint helpers to go through the entry point table populated
by llint_entry. Added helpers to OpcodeID enum for all builds.

  • bytecode/BytecodeList.json:
  • generate-bytecode-files:
  • llint/LLIntCLoop.cpp:

(JSC::LLInt::CLoop::initialize):
Reordered sections to match the order that the functions are added to the entry point
table. Added new "asmPrefix" property for symbols that have one name but are generated
with a prefix, e.g. op_enter -> llint_op_enter. Eliminated the "emitDefineID" property
as we are using enums for all bytecode references. Changed the C Loop only
llint_c_loop_init to llint_entry.

Source/WebKit:

Updated VS dependencies for JavaScriptCore changes.

  • WebKit.vcxproj/WebKit.sln:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/asm.rb

    r164164 r167094  
    173173    end
    174174
    175     def putsLabel(labelName)
     175    def putsLabel(labelName, isGlobal)
    176176        raise unless @state == :asm
    177177        @numGlobalLabels += 1
    178         putsProcEndIfNeeded if $emitWinAsm
     178        putsProcEndIfNeeded if $emitWinAsm and isGlobal
    179179        putsNewlineSpacerIfAppropriate(:global)
    180180        @internalComment = $enableLabelCountComments ? "Global Label #{@numGlobalLabels}" : nil
    181         if /\Allint_op_/.match(labelName)
     181        if isGlobal
     182            if !$emitWinAsm
     183                @outp.puts(formatDump("OFFLINE_ASM_GLOBAL_LABEL(#{labelName})", lastComment))
     184            else
     185                putsProc(labelName, lastComment)
     186            end           
     187        elsif /\Allint_op_/.match(labelName)
    182188            if !$emitWinAsm
    183189                @outp.puts(formatDump("OFFLINE_ASM_OPCODE_LABEL(op_#{$~.post_match})", lastComment))
    184190            else
    185191                label = "llint_" + "op_#{$~.post_match}"
    186                 putsProc(label, lastComment)
    187             end
     192                @outp.puts(formatDump("  _#{label}:", lastComment))
     193            end           
    188194        else
    189195            if !$emitWinAsm
    190196                @outp.puts(formatDump("OFFLINE_ASM_GLUE_LABEL(#{labelName})", lastComment))
    191197            else
    192                 putsProc(labelName, lastComment)
     198                @outp.puts(formatDump("  _#{labelName}:", lastComment))
    193199            end
    194200        end
     
    207213        end
    208214    end
    209    
     215
     216    def self.externLabelReference(labelName)
     217        if !$emitWinAsm
     218            "\" LOCAL_REFERENCE(#{labelName}) \""
     219        else
     220            "#{labelName}"
     221        end
     222    end
     223
    210224    def self.labelReference(labelName)
    211225        if !$emitWinAsm
    212             "\" LOCAL_REFERENCE(#{labelName}) \""
    213         else
    214             "#{labelName}"
     226            "\" LOCAL_LABEL_STRING(#{labelName}) \""
     227        else
     228            "_#{labelName}"
    215229        end
    216230    end
     
    262276    end
    263277end
     278
     279IncludeFile.processIncludeOptions()
    264280
    265281asmFile = ARGV.shift
Note: See TracChangeset for help on using the changeset viewer.