summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/offlineasm/asm.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/offlineasm/asm.rb')
-rw-r--r--Source/JavaScriptCore/offlineasm/asm.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/offlineasm/asm.rb b/Source/JavaScriptCore/offlineasm/asm.rb
index 1603f4af4..14d616442 100644
--- a/Source/JavaScriptCore/offlineasm/asm.rb
+++ b/Source/JavaScriptCore/offlineasm/asm.rb
@@ -96,6 +96,12 @@ class Assembler
result
end
+ # Puts a C Statement in the output stream.
+ def putc(*line)
+ raise unless @state == :asm
+ @outp.puts(formatDump(" " + line.join(''), lastComment))
+ end
+
def formatDump(dumpStr, comment, commentColumns=$preferredCommentStartColumn)
if comment.length > 0
"%-#{commentColumns}s %s" % [dumpStr, comment]
@@ -151,7 +157,11 @@ class Assembler
@numGlobalLabels += 1
putsNewlineSpacerIfAppropriate(:global)
@internalComment = $enableLabelCountComments ? "Global Label #{@numGlobalLabels}" : nil
- @outp.puts(formatDump("OFFLINE_ASM_GLOBAL_LABEL(#{labelName})", lastComment))
+ if /\Allint_op_/.match(labelName)
+ @outp.puts(formatDump("OFFLINE_ASM_OPCODE_LABEL(op_#{$~.post_match})", lastComment))
+ else
+ @outp.puts(formatDump("OFFLINE_ASM_GLUE_LABEL(#{labelName})", lastComment))
+ end
@newlineSpacerState = :none # After a global label, we can use another spacer.
end
@@ -171,6 +181,14 @@ class Assembler
"\" LOCAL_LABEL_STRING(#{labelName}) \""
end
+ def self.cLabelReference(labelName)
+ "#{labelName}"
+ end
+
+ def self.cLocalLabelReference(labelName)
+ "#{labelName}"
+ end
+
def codeOrigin(text)
case @commentState
when :none