Ignore:
Timestamp:
Jul 13, 2012, 5:44:47 PM (13 years ago)
Author:
[email protected]
Message:

OfflineASM Pretty printing and commenting enhancements.
https://bugs.webkit.org/show_bug.cgi?id=91281

Patch by Mark Lam <[email protected]> on 2012-07-13
Reviewed by Filip Pizlo.

Added some minor pretty printing in the OfflineASM.
Also added infrastruture for adding multiple types of comments and
annotations with the ability to enable/disable them in the generated
output as desired.

  • GNUmakefile.list.am: add new file config.rb.
  • llint/LLIntOfflineAsmConfig.h: Added OFFLINE_ASM_BEGIN, OFFLINE_ASM_END, and OFFLINE_ASM_LOCAL_LABEL macros. This will allow us to redefine these for other backends later.
  • llint/LowLevelInterpreter32_64.asm: Add a small example of instruction annotations for now.
  • llint/LowLevelInterpreter64.asm: Add a small example of instruction annotations for now.
  • offlineasm/armv7.rb: Added handling of annotations.
  • offlineasm/asm.rb: Added machinery to dump the new comments and annotations. Also added some indentations to make the output a little prettier.
  • offlineasm/ast.rb: Added annotation field in class Instruction.
  • offlineasm/backends.rb:
  • offlineasm/config.rb: Added. Currently only contains commenting options. This file is meant to be a centralized place for build config values much like config.h for JavaScriptCore.
  • offlineasm/generate_offset_extractor.rb:
  • offlineasm/instructions.rb:
  • offlineasm/offsets.rb:
  • offlineasm/opt.rb:
  • offlineasm/parser.rb: Parse and record annotations.
  • offlineasm/registers.rb:
  • offlineasm/self_hash.rb:
  • offlineasm/settings.rb:
  • offlineasm/transform.rb:
  • offlineasm/x86.rb: Added handling of annotations.
File:
1 edited

Legend:

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

    r110383 r122650  
    2121# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
    2222# THE POSSIBILITY OF SUCH DAMAGE.
     23
     24require "config"
    2325
    2426#
     
    785787
    786788class Instruction < Node
    787     attr_reader :opcode, :operands
    788    
    789     def initialize(codeOrigin, opcode, operands)
     789    attr_reader :opcode, :operands, :annotation
     790   
     791    def initialize(codeOrigin, opcode, operands, annotation=nil)
    790792        super(codeOrigin)
    791793        @opcode = opcode
    792794        @operands = operands
     795        @annotation = annotation
    793796    end
    794797   
     
    798801   
    799802    def mapChildren(&proc)
    800         Instruction.new(codeOrigin, @opcode, @operands.map(&proc))
     803        Instruction.new(codeOrigin, @opcode, @operands.map(&proc), @annotation)
    801804    end
    802805   
Note: See TracChangeset for help on using the changeset viewer.