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

Unified Diff: src/runtime.cc

Issue 18695004: Add internal fields to JSArrayBufferViews (JSTypedArray and JSDataView) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 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/objects-visiting-inl.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index e3ee6d56c3c09937b1909e75644437e8a41df5dd..48b55afddd727488beba97475853dd362791bc23 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -796,6 +796,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_TypedArrayInitialize) {
CONVERT_ARG_HANDLE_CHECKED(Object, byte_offset_object, 3);
CONVERT_ARG_HANDLE_CHECKED(Object, byte_length_object, 4);
+ ASSERT(holder->GetInternalFieldCount() ==
+ v8::ArrayBufferView::kInternalFieldCount);
+ for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) {
+ holder->SetInternalField(i, Smi::FromInt(0));
+ }
+
ExternalArrayType arrayType;
size_t elementSize;
switch (arrayId) {
@@ -1012,6 +1018,12 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DataViewInitialize) {
CONVERT_ARG_HANDLE_CHECKED(Object, byte_offset, 2);
CONVERT_ARG_HANDLE_CHECKED(Object, byte_length, 3);
+ ASSERT(holder->GetInternalFieldCount() ==
+ v8::ArrayBufferView::kInternalFieldCount);
+ for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) {
+ holder->SetInternalField(i, Smi::FromInt(0));
+ }
+
holder->set_buffer(*buffer);
ASSERT(byte_offset->IsNumber());
ASSERT(
« no previous file with comments | « src/objects-visiting-inl.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698