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

Unified Diff: src/js/typedarray.js

Issue 1949863002: Fix TypedArray Property optimizations (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use CreateFunction Created 4 years, 7 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
Index: src/js/typedarray.js
diff --git a/src/js/typedarray.js b/src/js/typedarray.js
index 18f6dde29975de4ba34b824b5c9f57fa84061efe..0f335d37b58abb575696875a08bc1b62913011ff 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -68,6 +68,8 @@ endmacro
TYPED_ARRAYS(DECLARE_GLOBALS)
+var TypedArray = %object_get_prototype_of(GlobalUint8Array);
+
utils.Import(function(from) {
ArrayValues = from.ArrayValues;
GetIterator = from.GetIterator;
@@ -808,7 +810,7 @@ function TypedArrayFrom(source, mapfn, thisArg) {
}
%FunctionSetLength(TypedArrayFrom, 1);
-function TypedArray() {
+function TypedArrayConstructor() {
if (IS_UNDEFINED(new.target)) {
throw MakeTypeError(kConstructorNonCallable, "TypedArray");
}
@@ -819,9 +821,10 @@ function TypedArray() {
// -------------------------------------------------------------------
-%FunctionSetPrototype(TypedArray, new GlobalObject());
+%SetCode(TypedArray, TypedArrayConstructor);
%AddNamedProperty(TypedArray.prototype,
"constructor", TypedArray, DONT_ENUM);
+
utils.InstallFunctions(TypedArray, DONT_ENUM, [
"from", TypedArrayFrom,
"of", TypedArrayOf

Powered by Google App Engine
This is Rietveld 408576698