diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/offlineasm/cloop.rb | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/offlineasm/cloop.rb')
-rw-r--r-- | Source/JavaScriptCore/offlineasm/cloop.rb | 72 |
1 files changed, 40 insertions, 32 deletions
diff --git a/Source/JavaScriptCore/offlineasm/cloop.rb b/Source/JavaScriptCore/offlineasm/cloop.rb index 852e864e9..7e939480e 100644 --- a/Source/JavaScriptCore/offlineasm/cloop.rb +++ b/Source/JavaScriptCore/offlineasm/cloop.rb @@ -1,4 +1,4 @@ -# Copyright (C) 2012 Apple Inc. All rights reserved. +# Copyright (C) 2012, 2014 Apple Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -68,34 +68,22 @@ C_LOOP_SCRATCH_FPR = SpecialRegister.new("d6") class RegisterID def clDump case name - when "a0" - "a0" - when "a1" - "a1" - when "a2" - "a2" - when "a3" - "a3" - when "a4" - "a4" - when "a5" - "a5" - when "a6" - "a6" - when "a6" - "a6" - when "t0" + # The cloop is modelled on the ARM implementation. Hence, the a0-a3 + # registers are aliases for r0-r3 i.e. t0-t3 in our case. + when "t0", "a0", "r0" "t0" - when "t1" + when "t1", "a1", "r1" "t1" - when "t2" + when "t2", "a2" "t2" - when "t3" + when "t3", "a3" "t3" when "t4" - "rPC" - when "t6" - "rBasePC" + "pc" + when "t5" + "t5" + when "csr0" + "pcBase" when "csr1" "tagTypeNumber" when "csr2" @@ -103,7 +91,7 @@ class RegisterID when "cfr" "cfr" when "lr" - "rRetVPC" + "lr" when "sp" "sp" else @@ -555,14 +543,18 @@ end # operands: callTarget, currentFrame, currentPC def cloopEmitCallSlowPath(operands) $asm.putc "{" - $asm.putc " ExecState* exec = CAST<ExecState*>(#{operands[1].clValue(:voidPtr)});" - $asm.putc " Instruction* pc = CAST<Instruction*>(#{operands[2].clValue(:voidPtr)});" - $asm.putc " SlowPathReturnType result = #{operands[0].cLabel}(exec, pc);" - $asm.putc " decodeResult(result, t0.instruction, t1.vp);" + $asm.putc " SlowPathReturnType result = #{operands[0].cLabel}(#{operands[1].clDump}, #{operands[2].clDump});" + $asm.putc " decodeResult(result, t0.vp, t1.vp);" $asm.putc "}" end +def cloopEmitCallSlowPathVoid(operands) + $asm.putc "#{operands[0].cLabel}(#{operands[1].clDump}, #{operands[2].clDump});" +end + class Instruction + @@didReturnFromJSLabelCounter = 0 + def lowerC_LOOP $asm.codeOrigin codeOriginString if $enableCodeOriginComments $asm.annotation annotation if $enableInstrAnnotations && (opcode != "cloopDo") @@ -876,7 +868,8 @@ class Instruction when "break" $asm.putc "CRASH(); // break instruction not implemented." when "ret" - $asm.putc "goto doReturnHelper;" + $asm.putc "opcode = lr.opcode;" + $asm.putc "DISPATCH_OPCODE();" when "cbeq" cloopEmitCompareAndSet(operands, :uint8, "==") @@ -1097,8 +1090,17 @@ class Instruction cloopEmitOpAndBranch(operands, "|", :int32, "!= 0") when "memfence" - when "pushCalleeSaves" - when "popCalleeSaves" + + when "push" + operands.each { + | op | + $asm.putc "PUSH(#{op.clDump});" + } + when "pop" + operands.each { + | op | + $asm.putc "POP(#{op.clDump});" + } # A convenience and compact call to crash because we don't want to use @@ -1113,8 +1115,11 @@ class Instruction # use of the call instruction. Instead, we just implement JS calls # as an opcode dispatch. when "cloopCallJSFunction" + @@didReturnFromJSLabelCounter += 1 + $asm.putc "lr.opcode = getOpcode(llint_cloop_did_return_from_js_#{@@didReturnFromJSLabelCounter});" $asm.putc "opcode = #{operands[0].clValue(:opcode)};" $asm.putc "DISPATCH_OPCODE();" + $asm.putsLabel("llint_cloop_did_return_from_js_#{@@didReturnFromJSLabelCounter}", false) # We can't do generic function calls with an arbitrary set of args, but # fortunately we don't have to here. All native function calls always @@ -1135,6 +1140,9 @@ class Instruction when "cloopCallSlowPath" cloopEmitCallSlowPath(operands) + when "cloopCallSlowPathVoid" + cloopEmitCallSlowPathVoid(operands) + # For debugging only. This is used to insert instrumentation into the # generated LLIntAssembly.h during llint development only. Do not use # for production code. |