⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 211306 in webkit


Ignore:
Timestamp:
Jan 27, 2017, 3:29:26 PM (10 years ago)
Author:
Yusuke Suzuki
Message:

Extend create_hash_table to specify Intrinsic
​https://bugs.webkit.org/show_bug.cgi?id=167505

Reviewed by Sam Weinig.

This patch extends create_hash_table to specify Intrinsic.
We can set Intrinsic in the static property table definition
in runtime/XXX.h.

And drop the adhoc code for String.fromCharCode in create_hash_table.

  • create_hash_table:
  • runtime/StringConstructor.cpp:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r211300 r211306  
     12017-01-27  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        Extend create_hash_table to specify Intrinsic
     4        https://bugs.webkit.org/show_bug.cgi?id=167505
     5
     6        Reviewed by Sam Weinig.
     7
     8        This patch extends create_hash_table to specify Intrinsic.
     9        We can set Intrinsic in the static property table definition
     10        in runtime/XXX.h.
     11
     12        And drop the adhoc code for String.fromCharCode in create_hash_table.
     13
     14        * create_hash_table:
     15        * runtime/StringConstructor.cpp:
     16
    1172017-01-27  Filip Pizlo  <fpizlo@apple.com>
    218
  • trunk/Source/JavaScriptCore/create_hash_table

    r207576 r211306  
    7777
    7878        $inside = 0;
    79     } elsif (/^(\S+)\s*(\S+)\s*([\w\|]*)\s*(\w*)\s*$/ && $inside) {
     79    } elsif (/^(\S+)\s*(\S+)\s*([\w\|]*)\s*(\w*)\s*(\w*)\s*$/ && $inside) {
    8080        my $key = $1;
    8181        my $val = $2;
    8282        my $att = $3;
    8383        my $param = $4;
     84        my $intrinsic = $5;
    8485
    8586        push(@keys, $key);
    … …  
    9192
    9293        if ($att =~ m/Function/) {
    93             push(@values, { "type" => "Function", "function" => $val, "params" => (length($param) ? $param : "") });
     94            push(@values, { "type" => "Function", "function" => $val, "params" => (length($param) ? $param : ""), "intrinsic" => (length($intrinsic) ? $intrinsic : "NoIntrinsic") });
    9495            #printf STDERR "WARNING: Number of arguments missing for $key/$val\n" if (length($param) == 0);
    9596        } elsif ($att =~ m/Accessor/) {
    … …  
    302303        my $firstCastStr = "";
    303304        my $secondCastStr = "";
     305        my $intrinsic = "NoIntrinsic";
    304306
    305307        if ($values[$i]{"type"} eq "Function") {
    … …  
    307309            $firstValue = $values[$i]{"function"};
    308310            $secondValue = $values[$i]{"params"};
     311            $intrinsic = $values[$i]{"intrinsic"};
    309312        } elsif ($values[$i]{"type"} eq "Accessor") {
    310313            $firstCastStr = "static_cast<NativeFunction>";
    … …  
    330333        }
    331334
    332         my $intrinsic = "NoIntrinsic";
    333         $intrinsic = "FromCharCodeIntrinsic" if ($key eq "fromCharCode");
    334         if ($name eq "arrayPrototypeTable") {
    335             $intrinsic = "ArrayPushIntrinsic" if ($key eq "push");
    336             $intrinsic = "ArrayPopIntrinsic" if ($key eq "pop");
    337         }
    338 
    339335        if ($values[$i]{"type"} eq "Function" && $firstValue eq "JSBuiltin")  {
    340336            my $tableHead = $name;
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r209229 r211306  
    4545/* Source for StringConstructor.lut.h
    4646@begin stringConstructorTable
    47   fromCharCode          stringFromCharCode         DontEnum|Function 1
     47  fromCharCode          stringFromCharCode         DontEnum|Function 1 FromCharCodeIntrinsic
    4848  fromCodePoint         stringFromCodePoint        DontEnum|Function 1
    4949  raw                   JSBuiltin                  DontEnum|Function 1
Note: See TracChangeset for help on using the changeset viewer.