Title: [163351] trunk/Source/_javascript_Core
Revision
163351
Author
[email protected]
Date
2014-02-03 18:08:23 -0800 (Mon, 03 Feb 2014)

Log Message

LLInt: Regex for pseudo-instructions is too big
https://bugs.webkit.org/show_bug.cgi?id=128148

Reviewed by Mark Lam.

* offlineasm/instructions.rb:
* offlineasm/parser.rb:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (163350 => 163351)


--- trunk/Source/_javascript_Core/ChangeLog	2014-02-04 02:02:53 UTC (rev 163350)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-02-04 02:08:23 UTC (rev 163351)
@@ -1,3 +1,13 @@
+2014-02-03  Mark Hahnenberg  <[email protected]>
+
+        LLInt: Regex for pseudo-instructions is too big
+        https://bugs.webkit.org/show_bug.cgi?id=128148
+
+        Reviewed by Mark Lam.
+
+        * offlineasm/instructions.rb:
+        * offlineasm/parser.rb:
+
 2014-02-03  Brian Burg  <[email protected]>
 
         Web Replay: upstream base input classes and the input cursor interface

Modified: trunk/Source/_javascript_Core/offlineasm/instructions.rb (163350 => 163351)


--- trunk/Source/_javascript_Core/offlineasm/instructions.rb	2014-02-04 02:02:53 UTC (rev 163350)
+++ trunk/Source/_javascript_Core/offlineasm/instructions.rb	2014-02-04 02:08:23 UTC (rev 163351)
@@ -22,6 +22,7 @@
 # THE POSSIBILITY OF SUCH DAMAGE.
 
 require "config"
+require "set"
 
 # Interesting invariant, which we take advantage of: branching instructions
 # always begin with "b", and no non-branching instructions begin with "b".
@@ -321,7 +322,7 @@
 
 INSTRUCTIONS = MACRO_INSTRUCTIONS + X86_INSTRUCTIONS + ARM_INSTRUCTIONS + ARM64_INSTRUCTIONS + RISC_INSTRUCTIONS + MIPS_INSTRUCTIONS + SH4_INSTRUCTIONS + CXX_INSTRUCTIONS
 
-INSTRUCTION_PATTERN = Regexp.new('\\A((' + INSTRUCTIONS.join(')|(') + '))\\Z')
+INSTRUCTION_SET = INSTRUCTIONS.to_set
 
 def isBranch(instruction)
     instruction =~ /^b/

Modified: trunk/Source/_javascript_Core/offlineasm/parser.rb (163350 => 163351)


--- trunk/Source/_javascript_Core/offlineasm/parser.rb	2014-02-04 02:02:53 UTC (rev 163350)
+++ trunk/Source/_javascript_Core/offlineasm/parser.rb	2014-02-04 02:08:23 UTC (rev 163351)
@@ -153,13 +153,13 @@
 end
 
 def isInstruction(token)
-    token =~ INSTRUCTION_PATTERN
+    INSTRUCTION_SET.member? token.string
 end
 
 def isKeyword(token)
     token =~ /\A((true)|(false)|(if)|(then)|(else)|(elsif)|(end)|(and)|(or)|(not)|(macro)|(const)|(sizeof)|(error)|(include))\Z/ or
         token =~ REGISTER_PATTERN or
-        token =~ INSTRUCTION_PATTERN
+        isInstruction(token)
 end
 
 def isIdentifier(token)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to