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

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

Issue 1712163002: [builtins] Migrate the DataView constructor to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/runtime/runtime.h ('k') | test/mjsunit/es6/typedarray.js » ('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 a82b71ddf283748d2136a17660d98e1a5bf341f6..bf0ee9f1c136d087f61f6708f13e9cb928a1c3f2 100644
--- a/src/runtime/runtime-typedarray.cc
+++ b/src/runtime/runtime-typedarray.cc
@@ -414,42 +414,6 @@ RUNTIME_FUNCTION(Runtime_IsSharedInteger32TypedArray) {
}
-RUNTIME_FUNCTION(Runtime_DataViewInitialize) {
- HandleScope scope(isolate);
- DCHECK(args.length() == 4);
- CONVERT_ARG_HANDLE_CHECKED(JSDataView, holder, 0);
- CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 1);
- CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_offset, 2);
- CONVERT_NUMBER_ARG_HANDLE_CHECKED(byte_length, 3);
-
- DCHECK_EQ(v8::ArrayBufferView::kInternalFieldCount,
- holder->GetInternalFieldCount());
- for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) {
- holder->SetInternalField(i, Smi::FromInt(0));
- }
- size_t buffer_length = 0;
- size_t offset = 0;
- size_t length = 0;
- RUNTIME_ASSERT(
- TryNumberToSize(isolate, buffer->byte_length(), &buffer_length));
- RUNTIME_ASSERT(TryNumberToSize(isolate, *byte_offset, &offset));
- RUNTIME_ASSERT(TryNumberToSize(isolate, *byte_length, &length));
-
- // TODO(jkummerow): When we have a "safe numerics" helper class, use it here.
- // Entire range [offset, offset + length] must be in bounds.
- RUNTIME_ASSERT(offset <= buffer_length);
- RUNTIME_ASSERT(offset + length <= buffer_length);
- // No overflow.
- RUNTIME_ASSERT(offset + length >= offset);
-
- holder->set_buffer(*buffer);
- holder->set_byte_offset(*byte_offset);
- holder->set_byte_length(*byte_length);
-
- return isolate->heap()->undefined_value();
-}
-
-
inline static bool NeedToFlipBytes(bool is_little_endian) {
#ifdef V8_TARGET_LITTLE_ENDIAN
return !is_little_endian;
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/es6/typedarray.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698