Ignore:
Timestamp:
Jul 29, 2017, 8:01:12 PM (8 years ago)
Author:
[email protected]
Message:

LLInt offsets extractor should be able to handle C++ constexprs
https://bugs.webkit.org/show_bug.cgi?id=174964

Reviewed by Saam Barati.

This patch adds new syntax to the offline asm language. The new keyword,
constexpr, takes the subsequent identifier and maps it to a C++ constexpr
expression. Additionally, if the value is not an identifier you can wrap it in
parentheses. e.g. constexpr (myConstexprFunction() + OBJECT_OFFSET(Foo, bar)),
which will get converted into:
static_cast<int64_t>(myConstexprFunction() + OBJECT_OFFSET(Foo, bar));

This patch also changes the data format the LLIntOffsetsExtractor
binary produces. Previously, it would produce unsigned values,
after this patch every value is an int64_t. Using an int64_t is
useful because it means that we can represent any constant needed.
int32_t masks are sign extended then passed then converted to a
negative literal sting in the assembler so it will be the constant
expected.

  • llint/LLIntOffsetsExtractor.cpp:

(JSC::LLIntOffsetsExtractor::dummy):

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter64.asm:
  • offlineasm/asm.rb:
  • offlineasm/ast.rb:
  • offlineasm/generate_offset_extractor.rb:
  • offlineasm/offsets.rb:
  • offlineasm/parser.rb:
  • offlineasm/transform.rb:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/asm.rb

    r206759 r220047  
    316316rescue MissingMagicValuesException
    317317    $stderr.puts "offlineasm: No magic values found. Skipping assembly file generation."
    318     exit 0
     318    exit 1
    319319end
    320320
     
    367367            end
    368368
    369             lowLevelAST = lowLevelAST.resolve(*buildOffsetsMap(lowLevelAST, offsetsList))
     369            lowLevelAST = lowLevelAST.resolve(buildOffsetsMap(lowLevelAST, offsetsList))
    370370            lowLevelAST.validate
    371371            emitCodeInConfiguration(concreteSettings, lowLevelAST, backend) {
Note: See TracChangeset for help on using the changeset viewer.