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

Unified Diff: src/js/typedarray.js

Issue 1624383003: Restore per-TypedArray-class length accessors as a perf workaround (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More TODOs Created 4 years, 11 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/mjsunit/es6/typedarray-proto.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/typedarray.js
diff --git a/src/js/typedarray.js b/src/js/typedarray.js
index b3e1c829dd62b9926a3c335f952a20a233dc22db..fd668a57fddceb2222d31d91ccad806dc5395bc8 100644
--- a/src/js/typedarray.js
+++ b/src/js/typedarray.js
@@ -263,6 +263,14 @@ function NAMEConstructor(arg1, arg2, arg3) {
}
}
+// TODO(littledan): Remove this performance workaround BUG(chromium:579905)
+function NAME_GetLength() {
+ if (!(%_ClassOf(this) === 'NAME')) {
+ throw MakeTypeError(kIncompatibleMethodReceiver, "NAME.length", this);
+ }
+ return %_TypedArrayGetLength(this);
+}
+
function NAMESubArray(begin, end) {
var beginInt = TO_INTEGER(begin);
if (!IS_UNDEFINED(end)) {
@@ -829,6 +837,9 @@ macro SETUP_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE)
%AddNamedProperty(GlobalNAME.prototype,
"BYTES_PER_ELEMENT", ELEMENT_SIZE,
READ_ONLY | DONT_ENUM | DONT_DELETE);
+ // TODO(littledan): Remove this performance workaround BUG(chromium:579905)
+ utils.InstallGetter(GlobalNAME.prototype, "length", NAME_GetLength,
+ DONT_ENUM | DONT_DELETE);
endmacro
TYPED_ARRAYS(SETUP_TYPED_ARRAY)
« no previous file with comments | « no previous file | test/mjsunit/es6/typedarray-proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698