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

Unified Diff: src/harmony-array.js

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. 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 | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index e94134b81aa851a9539ceb86d38e72971279fa78..709a6e9e459b553d7bf755f4d83c610e36eed0a8 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -83,7 +83,7 @@ function InnerArrayCopyWithin(target, start, end, array, length) {
function ArrayCopyWithin(target, start, end) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.copyWithin");
- var array = TO_OBJECT_INLINE(this);
+ var array = TO_OBJECT(this);
var length = $toLength(array.length);
return InnerArrayCopyWithin(target, start, end, array, length);
@@ -103,7 +103,7 @@ function InnerArrayFind(predicate, thisArg, array, length) {
for (var i = 0; i < length; i++) {
var element = array[i];
- var newThisArg = needs_wrapper ? $toObject(thisArg) : thisArg;
+ var newThisArg = needs_wrapper ? TO_OBJECT(thisArg) : thisArg;
if (%_CallFunction(newThisArg, element, i, array, predicate)) {
return element;
}
@@ -116,7 +116,7 @@ function InnerArrayFind(predicate, thisArg, array, length) {
function ArrayFind(predicate, thisArg) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.find");
- var array = $toObject(this);
+ var array = TO_OBJECT(this);
var length = $toInteger(array.length);
return InnerArrayFind(predicate, thisArg, array, length);
@@ -136,7 +136,7 @@ function InnerArrayFindIndex(predicate, thisArg, array, length) {
for (var i = 0; i < length; i++) {
var element = array[i];
- var newThisArg = needs_wrapper ? $toObject(thisArg) : thisArg;
+ var newThisArg = needs_wrapper ? TO_OBJECT(thisArg) : thisArg;
if (%_CallFunction(newThisArg, element, i, array, predicate)) {
return i;
}
@@ -149,7 +149,7 @@ function InnerArrayFindIndex(predicate, thisArg, array, length) {
function ArrayFindIndex(predicate, thisArg) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.findIndex");
- var array = $toObject(this);
+ var array = TO_OBJECT(this);
var length = $toInteger(array.length);
return InnerArrayFindIndex(predicate, thisArg, array, length);
@@ -187,7 +187,7 @@ function InnerArrayFill(value, start, end, array, length) {
function ArrayFill(value, start, end) {
CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill");
- var array = $toObject(this);
+ var array = TO_OBJECT(this);
var length = TO_UINT32(array.length);
return InnerArrayFill(value, start, end, array, length);
@@ -205,7 +205,7 @@ function AddArrayElement(constructor, array, i, value) {
// ES6, draft 10-14-14, section 22.1.2.1
function ArrayFrom(arrayLike, mapfn, receiver) {
- var items = $toObject(arrayLike);
+ var items = TO_OBJECT(arrayLike);
var mapping = !IS_UNDEFINED(mapfn);
if (mapping) {
@@ -215,7 +215,7 @@ function ArrayFrom(arrayLike, mapfn, receiver) {
if (IS_NULL(receiver)) {
receiver = UNDEFINED;
} else if (!IS_UNDEFINED(receiver)) {
- receiver = TO_OBJECT_INLINE(receiver);
+ receiver = TO_OBJECT(receiver);
}
}
}
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/harmony-array-includes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698