Title: [211306] trunk/Source/_javascript_Core
Revision
211306
Author
utatane....@gmail.com
Date
2017-01-27 15:29:26 -0800 (Fri, 27 Jan 2017)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (211305 => 211306)


--- trunk/Source/_javascript_Core/ChangeLog	2017-01-27 23:16:17 UTC (rev 211305)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-01-27 23:29:26 UTC (rev 211306)
@@ -1,3 +1,19 @@
+2017-01-27  Yusuke Suzuki  <utatane....@gmail.com>
+
+        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:
+
 2017-01-27  Filip Pizlo  <fpi...@apple.com>
 
         scanExternalRememberedSet needs to mergeIfNecessary

Modified: trunk/Source/_javascript_Core/create_hash_table (211305 => 211306)


--- trunk/Source/_javascript_Core/create_hash_table	2017-01-27 23:16:17 UTC (rev 211305)
+++ trunk/Source/_javascript_Core/create_hash_table	2017-01-27 23:29:26 UTC (rev 211306)
@@ -76,11 +76,12 @@
         $includeBuiltin = 0;
 
         $inside = 0;
-    } elsif (/^(\S+)\s*(\S+)\s*([\w\|]*)\s*(\w*)\s*$/ && $inside) {
+    } elsif (/^(\S+)\s*(\S+)\s*([\w\|]*)\s*(\w*)\s*(\w*)\s*$/ && $inside) {
         my $key = $1;
         my $val = $2;
         my $att = $3;
         my $param = $4;
+        my $intrinsic = $5;
 
         push(@keys, $key);
         push(@attrs, length($att) > 0 ? $att : "0");
@@ -90,7 +91,7 @@
         }
 
         if ($att =~ m/Function/) {
-            push(@values, { "type" => "Function", "function" => $val, "params" => (length($param) ? $param : "") });
+            push(@values, { "type" => "Function", "function" => $val, "params" => (length($param) ? $param : ""), "intrinsic" => (length($intrinsic) ? $intrinsic : "NoIntrinsic") });
             #printf STDERR "WARNING: Number of arguments missing for $key/$val\n" if (length($param) == 0);
         } elsif ($att =~ m/Accessor/) {
             my $get = $val;
@@ -301,11 +302,13 @@
         my $secondValue = "";
         my $firstCastStr = "";
         my $secondCastStr = "";
+        my $intrinsic = "NoIntrinsic";
 
         if ($values[$i]{"type"} eq "Function") {
             $firstCastStr = "static_cast<NativeFunction>";
             $firstValue = $values[$i]{"function"};
             $secondValue = $values[$i]{"params"};
+            $intrinsic = $values[$i]{"intrinsic"};
         } elsif ($values[$i]{"type"} eq "Accessor") {
             $firstCastStr = "static_cast<NativeFunction>";
             $secondCastStr = "static_cast<NativeFunction>";
@@ -329,13 +332,6 @@
             $secondValue = "0";
         }
 
-        my $intrinsic = "NoIntrinsic";
-        $intrinsic = "FromCharCodeIntrinsic" if ($key eq "fromCharCode");
-        if ($name eq "arrayPrototypeTable") {
-            $intrinsic = "ArrayPushIntrinsic" if ($key eq "push");
-            $intrinsic = "ArrayPopIntrinsic" if ($key eq "pop");
-        }
-
         if ($values[$i]{"type"} eq "Function" && $firstValue eq "JSBuiltin")  {
             my $tableHead = $name;
             $tableHead =~ s/Table$//;

Modified: trunk/Source/_javascript_Core/runtime/StringConstructor.cpp (211305 => 211306)


--- trunk/Source/_javascript_Core/runtime/StringConstructor.cpp	2017-01-27 23:16:17 UTC (rev 211305)
+++ trunk/Source/_javascript_Core/runtime/StringConstructor.cpp	2017-01-27 23:29:26 UTC (rev 211306)
@@ -44,7 +44,7 @@
 
 /* Source for StringConstructor.lut.h
 @begin stringConstructorTable
-  fromCharCode          stringFromCharCode         DontEnum|Function 1
+  fromCharCode          stringFromCharCode         DontEnum|Function 1 FromCharCodeIntrinsic
   fromCodePoint         stringFromCodePoint        DontEnum|Function 1
   raw                   JSBuiltin                  DontEnum|Function 1
 @end
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to