Upgrade to V8 3.6
Merge V8 at 3.6.6.11
Simple merge required updates to makefiles only.
Bug: 5688872
Change-Id: Ib38b7ffbcd409585f6cb6fccc59c767029cecc77
diff --git a/src/array.js b/src/array.js
index f73b0c1..98fe3ac 100644
--- a/src/array.js
+++ b/src/array.js
@@ -208,7 +208,7 @@
// Call ToString if toLocaleString is not a function.
// See issue 877615.
var e_obj = ToObject(e);
- if (IS_FUNCTION(e_obj.toLocaleString))
+ if (IS_SPEC_FUNCTION(e_obj.toLocaleString))
return ToString(e_obj.toLocaleString());
else
return ToString(e);
@@ -730,7 +730,7 @@
// In-place QuickSort algorithm.
// For short (length <= 22) arrays, insertion sort is used for efficiency.
- if (!IS_FUNCTION(comparefn)) {
+ if (!IS_SPEC_FUNCTION(comparefn)) {
comparefn = function (x, y) {
if (x === y) return 0;
if (%_IsSmi(x) && %_IsSmi(y)) {
@@ -993,7 +993,7 @@
["Array.prototype.filter"]);
}
- if (!IS_FUNCTION(f)) {
+ if (!IS_SPEC_FUNCTION(f)) {
throw MakeTypeError('called_non_callable', [ f ]);
}
if (IS_NULL_OR_UNDEFINED(receiver)) {
@@ -1022,7 +1022,7 @@
["Array.prototype.forEach"]);
}
- if (!IS_FUNCTION(f)) {
+ if (!IS_SPEC_FUNCTION(f)) {
throw MakeTypeError('called_non_callable', [ f ]);
}
if (IS_NULL_OR_UNDEFINED(receiver)) {
@@ -1048,7 +1048,7 @@
["Array.prototype.some"]);
}
- if (!IS_FUNCTION(f)) {
+ if (!IS_SPEC_FUNCTION(f)) {
throw MakeTypeError('called_non_callable', [ f ]);
}
if (IS_NULL_OR_UNDEFINED(receiver)) {
@@ -1073,7 +1073,7 @@
["Array.prototype.every"]);
}
- if (!IS_FUNCTION(f)) {
+ if (!IS_SPEC_FUNCTION(f)) {
throw MakeTypeError('called_non_callable', [ f ]);
}
if (IS_NULL_OR_UNDEFINED(receiver)) {
@@ -1097,7 +1097,7 @@
["Array.prototype.map"]);
}
- if (!IS_FUNCTION(f)) {
+ if (!IS_SPEC_FUNCTION(f)) {
throw MakeTypeError('called_non_callable', [ f ]);
}
if (IS_NULL_OR_UNDEFINED(receiver)) {
@@ -1245,7 +1245,7 @@
["Array.prototype.reduce"]);
}
- if (!IS_FUNCTION(callback)) {
+ if (!IS_SPEC_FUNCTION(callback)) {
throw MakeTypeError('called_non_callable', [callback]);
}
@@ -1281,7 +1281,7 @@
["Array.prototype.reduceRight"]);
}
- if (!IS_FUNCTION(callback)) {
+ if (!IS_SPEC_FUNCTION(callback)) {
throw MakeTypeError('called_non_callable', [callback]);
}
var i = ToUint32(this.length) - 1;
@@ -1314,12 +1314,13 @@
// -------------------------------------------------------------------
-function SetupArray() {
- // Setup non-enumerable constructor property on the Array.prototype
+function SetUpArray() {
+ %CheckIsBootstrapping();
+ // Set up non-enumerable constructor property on the Array.prototype
// object.
%SetProperty($Array.prototype, "constructor", $Array, DONT_ENUM);
- // Setup non-enumerable functions on the Array object.
+ // Set up non-enumerable functions on the Array object.
InstallFunctions($Array, DONT_ENUM, $Array(
"isArray", ArrayIsArray
));
@@ -1337,7 +1338,7 @@
return f;
}
- // Setup non-enumerable functions of the Array.prototype object and
+ // Set up non-enumerable functions of the Array.prototype object and
// set their names.
// Manipulate the length of some of the functions to meet
// expectations set by ECMA-262 or Mozilla.
@@ -1368,19 +1369,13 @@
%FinishArrayPrototypeSetup($Array.prototype);
// The internal Array prototype doesn't need to be fancy, since it's never
- // exposed to user code, so no hidden prototypes or DONT_ENUM attributes
- // are necessary.
- // The null __proto__ ensures that we never inherit any user created
- // getters or setters from, e.g., Object.prototype.
- InternalArray.prototype.__proto__ = null;
- // Adding only the functions that are actually used, and a toString.
- InternalArray.prototype.join = getFunction("join", ArrayJoin);
- InternalArray.prototype.pop = getFunction("pop", ArrayPop);
- InternalArray.prototype.push = getFunction("push", ArrayPush);
- InternalArray.prototype.toString = function() {
- return "Internal Array, length " + this.length;
- };
+ // exposed to user code.
+ // Adding only the functions that are actually used.
+ SetUpLockedPrototype(InternalArray, $Array(), $Array(
+ "join", getFunction("join", ArrayJoin),
+ "pop", getFunction("pop", ArrayPop),
+ "push", getFunction("push", ArrayPush)
+ ));
}
-
-SetupArray();
+SetUpArray();