WebKit Bugzilla
Attachment 356242 Details for
Bug 192258
: Fix the bytecode code generator scripts to pretty print Bytecodes.h.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch.
bug-192258.patch (text/plain), 3.32 KB, created by
Mark Lam
on 2018-11-30 14:46:49 PST
(
hide
)
Description:
proposed patch.
Filename:
MIME Type:
Creator:
Mark Lam
Created:
2018-11-30 14:46:49 PST
Size:
3.32 KB
patch
obsolete
>Index: Source/JavaScriptCore/ChangeLog >=================================================================== >--- Source/JavaScriptCore/ChangeLog (revision 238757) >+++ Source/JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2018-11-30 Mark Lam <mark.lam@apple.com> >+ >+ Fix the bytecode code generator scripts to pretty print Bytecodes.h. >+ https://bugs.webkit.org/show_bug.cgi?id=192258 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This makes Bytecodes.h more human readable. >+ >+ * generator/DSL.rb: >+ * generator/Section.rb: >+ > 2018-11-30 Mark Lam <mark.lam@apple.com> > > Add the generator directory to the Xcode project. >Index: Source/JavaScriptCore/generator/DSL.rb >=================================================================== >--- Source/JavaScriptCore/generator/DSL.rb (revision 238756) >+++ Source/JavaScriptCore/generator/DSL.rb (working copy) >@@ -99,13 +99,12 @@ module DSL > > def self.write_bytecodes(bytecode_list, bytecodes_filename) > GeneratedFile::create(bytecodes_filename, bytecode_list) do |template| >- template.prefix = "#pragma once" >+ template.prefix = "#pragma once\n" > num_opcodes = @sections.map(&:opcodes).flatten.size > template.body = <<-EOF >- #{@sections.map { |s| s.header_helpers(num_opcodes) }.join("\n")} >- >- #define FOR_EACH_BYTECODE_STRUCT(macro) \\ >- #{opcodes_for(:emit_in_structs_file).map { |op| "macro(#{op.capitalized_name}) \\" }.join("\n")} >+#{@sections.map { |s| s.header_helpers(num_opcodes) }.join("\n")} >+#define FOR_EACH_BYTECODE_STRUCT(macro) \\ >+#{opcodes_for(:emit_in_structs_file).map { |op| " macro(#{op.capitalized_name}) \\" }.join("\n")} > EOF > end > end >Index: Source/JavaScriptCore/generator/Section.rb >=================================================================== >--- Source/JavaScriptCore/generator/Section.rb (revision 238756) >+++ Source/JavaScriptCore/generator/Section.rb (working copy) >@@ -61,7 +61,7 @@ class Section > out = StringIO.new > if config[:emit_in_h_file] > out.write("#define FOR_EACH_#{config[:macro_name_component]}_ID(macro) \\\n") >- opcodes.each { |opcode| out.write("macro(#{opcode.name}, #{opcode.length}) \\\n") } >+ opcodes.each { |opcode| out.write(" macro(#{opcode.name}, #{opcode.length}) \\\n") } > out << "\n" > > out.write("#define NUMBER_OF_#{config[:macro_name_component]}_IDS #{opcodes.length}\n") >@@ -77,7 +77,7 @@ class Section > break > end > >- out.write("macro(sizeof(#{opcodes[i].capitalized_name}::Metadata))\\\n") >+ out.write(" macro(sizeof(#{opcodes[i].capitalized_name}::Metadata))\\\n") > i += 1 > end > out << "\n" >@@ -90,14 +90,12 @@ class Section > break > end > >- out.write("macro(alignof(#{opcodes[i].capitalized_name}::Metadata))\\\n") >+ out.write(" macro(alignof(#{opcodes[i].capitalized_name}::Metadata))\\\n") > i += 1 > end >- out << "\n" > end > > if config[:emit_opcode_id_string_values_in_h_file] >- out << "\n" > opcodes.each { |opcode| > out.write("#define #{opcode.name}_value_string \"#{opcode.id}\"\n") > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192258
: 356242