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

Unified Diff: src/js/harmony-simd.js

Issue 1439003002: [builtins] Get rid of a few %_ClassOf uses. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « src/js/harmony-atomics.js ('k') | src/js/macros.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/harmony-simd.js
diff --git a/src/js/harmony-simd.js b/src/js/harmony-simd.js
index 6847f2279a2911f21e9c2326dcdce90b74ac9985..a1de2e64c9da74a6f9356d4109483df107304619 100644
--- a/src/js/harmony-simd.js
+++ b/src/js/harmony-simd.js
@@ -62,11 +62,11 @@ function NAMECheckJS(a) {
}
function NAMEToString() {
- if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') {
+ var value = %_ValueOf(this);
+ if (typeof(value) !== 'TYPE') {
throw MakeTypeError(kIncompatibleMethodReceiver,
"NAME.prototype.toString", this);
}
- var value = %_ValueOf(this);
var str = "SIMD.NAME(";
str += %NAMEExtractLane(value, 0);
for (var i = 1; i < LANES; i++) {
@@ -76,11 +76,11 @@ function NAMEToString() {
}
function NAMEToLocaleString() {
- if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') {
+ var value = %_ValueOf(this);
+ if (typeof(value) !== 'TYPE') {
throw MakeTypeError(kIncompatibleMethodReceiver,
"NAME.prototype.toLocaleString", this);
}
- var value = %_ValueOf(this);
var str = "SIMD.NAME(";
str += %NAMEExtractLane(value, 0).toLocaleString();
for (var i = 1; i < LANES; i++) {
@@ -90,11 +90,12 @@ function NAMEToLocaleString() {
}
function NAMEValueOf() {
- if (typeof(this) !== 'TYPE' && %_ClassOf(this) !== 'NAME') {
+ var value = %_ValueOf(this);
+ if (typeof(value) !== 'TYPE') {
throw MakeTypeError(kIncompatibleMethodReceiver,
"NAME.prototype.valueOf", this);
}
- return %_ValueOf(this);
+ return value;
}
function NAMEExtractLaneJS(instance, lane) {
« no previous file with comments | « src/js/harmony-atomics.js ('k') | src/js/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698