Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: src/harmony-simd.js

Issue 1239423004: SIMD.js: Update Float32x4 and tests to current spec. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip tests that haven't been updated to new spec. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-simd.js
diff --git a/src/harmony-simd.js b/src/harmony-simd.js
index 4a1538237ef5859d987c864bd09d70942ee706f5..a4378167dacdbb5e3729ad7ad53d6bfad8a19a9d 100644
--- a/src/harmony-simd.js
+++ b/src/harmony-simd.js
@@ -44,7 +44,20 @@ function Float32x4ToString() {
x = GlobalFloat32x4.extractLane(value, 1),
y = GlobalFloat32x4.extractLane(value, 2),
z = GlobalFloat32x4.extractLane(value, 3);
- return "Float32x4(" + w + ", " + x + ", " + y + ", " + z + ")";
+ return "SIMD.Float32x4(" + w + ", " + x + ", " + y + ", " + z + ")";
+}
+
+function Float32x4ToLocaleString() {
+ if (!(IS_FLOAT32X4(this) || IS_FLOAT32X4_WRAPPER(this))) {
+ throw MakeTypeError(kIncompatibleMethodReceiver,
+ "Float32x4.prototype.toLocaleString", this);
+ }
+ var value = %_ValueOf(this);
+ var w = GlobalFloat32x4.extractLane(value, 0).toLocaleString(),
+ x = GlobalFloat32x4.extractLane(value, 1).toLocaleString(),
+ y = GlobalFloat32x4.extractLane(value, 2).toLocaleString(),
+ z = GlobalFloat32x4.extractLane(value, 3).toLocaleString();
+ return "SIMD.Float32x4(" + w + ", " + x + ", " + y + ", " + z + ")";
}
function Float32x4ValueOf() {
@@ -64,18 +77,19 @@ function Float32x4ExtractLaneJS(value, lane) {
// -------------------------------------------------------------------
%AddNamedProperty(GlobalSIMD, symbolToStringTag, 'SIMD', READ_ONLY | DONT_ENUM);
-%AddNamedProperty(GlobalSIMD, 'float32x4', GlobalFloat32x4, DONT_ENUM);
%SetCode(GlobalFloat32x4, Float32x4Constructor);
%FunctionSetPrototype(GlobalFloat32x4, {});
%AddNamedProperty(
GlobalFloat32x4.prototype, 'constructor', GlobalFloat32x4, DONT_ENUM);
%AddNamedProperty(
- GlobalFloat32x4, symbolToStringTag, 'Float32x4', DONT_ENUM | READ_ONLY);
+ GlobalFloat32x4.prototype, symbolToStringTag, 'Float32x4',
+ DONT_ENUM | READ_ONLY);
utils.InstallFunctions(GlobalFloat32x4.prototype, DONT_ENUM, [
- 'valueOf', Float32x4ValueOf,
+ 'toLocaleString', Float32x4ToLocaleString,
'toString', Float32x4ToString,
+ 'valueOf', Float32x4ValueOf,
]);
utils.InstallFunctions(GlobalFloat32x4, DONT_ENUM, [
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698