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

Unified Diff: src/runtime/runtime-typedarray.cc

Issue 1109353003: Unify internal and external typed arrays a bit (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 8 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/ppc/lithium-codegen-ppc.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-typedarray.cc
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc
index b95d20f1ddb7113af4d724a59b6aa9515aff7304..93ff56dbf7b9c9ec250643cf7eefdabe4ef24dd3 100644
--- a/src/runtime/runtime-typedarray.cc
+++ b/src/runtime/runtime-typedarray.cc
@@ -241,7 +241,9 @@ RUNTIME_FUNCTION(Runtime_TypedArrayInitialize) {
JSObject::SetMapAndElements(holder, map, elements);
DCHECK(IsExternalArrayElementsKind(holder->map()->elements_kind()));
} else {
- holder->set_buffer(Smi::FromInt(0));
+ Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer();
+ Runtime::SetupArrayBuffer(isolate, buffer, true, NULL, byte_length);
+ holder->set_buffer(*buffer);
Handle<FixedTypedArrayBase> elements =
isolate->factory()->NewFixedTypedArray(static_cast<int>(length),
array_type);
« no previous file with comments | « src/ppc/lithium-codegen-ppc.cc ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698