summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/offlineasm/backends.rb
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/JavaScriptCore/offlineasm/backends.rb
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/JavaScriptCore/offlineasm/backends.rb')
-rw-r--r--Source/JavaScriptCore/offlineasm/backends.rb51
1 files changed, 48 insertions, 3 deletions
diff --git a/Source/JavaScriptCore/offlineasm/backends.rb b/Source/JavaScriptCore/offlineasm/backends.rb
index 902a764af..274441997 100644
--- a/Source/JavaScriptCore/offlineasm/backends.rb
+++ b/Source/JavaScriptCore/offlineasm/backends.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 Apple Inc. All rights reserved.
+# Copyright (C) 2011, 2016 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -23,6 +23,7 @@
require "config"
require "arm"
+require "arm64"
require "ast"
require "x86"
require "mips"
@@ -32,10 +33,13 @@ require "cloop"
BACKENDS =
[
"X86",
+ "X86_WIN",
"X86_64",
+ "X86_64_WIN",
"ARM",
"ARMv7",
"ARMv7_TRADITIONAL",
+ "ARM64",
"MIPS",
"SH4",
"C_LOOP"
@@ -49,10 +53,13 @@ BACKENDS =
WORKING_BACKENDS =
[
"X86",
+ "X86_WIN",
"X86_64",
+ "X86_64_WIN",
"ARM",
"ARMv7",
"ARMv7_TRADITIONAL",
+ "ARM64",
"MIPS",
"SH4",
"C_LOOP"
@@ -60,6 +67,37 @@ WORKING_BACKENDS =
BACKEND_PATTERN = Regexp.new('\\A(' + BACKENDS.join(')|(') + ')\\Z')
+$allBackends = {}
+$validBackends = {}
+BACKENDS.each {
+ | backend |
+ $validBackends[backend] = true
+ $allBackends[backend] = true
+}
+
+def includeOnlyBackends(list)
+ newValidBackends = {}
+ list.each {
+ | backend |
+ if $validBackends[backend]
+ newValidBackends[backend] = true
+ end
+ }
+ $validBackends = newValidBackends
+end
+
+def isBackend?(backend)
+ $allBackends[backend]
+end
+
+def isValidBackend?(backend)
+ $validBackends[backend]
+end
+
+def validBackends
+ $validBackends.keys
+end
+
class Node
def lower(name)
begin
@@ -76,7 +114,8 @@ end
class Label
def lower(name)
- $asm.putsLabel(self.name[1..-1])
+ $asm.debugAnnotation codeOrigin.debugDirective if $enableDebugAnnotations
+ $asm.putsLabel(self.name[1..-1], @global)
end
end
@@ -88,8 +127,13 @@ end
class LabelReference
def asmLabel
- Assembler.labelReference(name[1..-1])
+ if extern?
+ Assembler.externLabelReference(name[1..-1])
+ else
+ Assembler.labelReference(name[1..-1])
+ end
end
+
def cLabel
Assembler.cLabelReference(name[1..-1])
end
@@ -99,6 +143,7 @@ class LocalLabelReference
def asmLabel
Assembler.localLabelReference("_offlineasm_"+name[1..-1])
end
+
def cLabel
Assembler.cLocalLabelReference("_offlineasm_"+name[1..-1])
end