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

Side by Side Diff: src/api.cc

Issue 2225013002: Remove unused isolate parameter from NumberToSize and TryNumberToSize (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/builtins/builtins-arraybuffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 6909 matching lines...) Expand 10 before | Expand all | Expand 10 after
6920 } else { 6920 } else {
6921 DCHECK(obj->IsJSTypedArray()); 6921 DCHECK(obj->IsJSTypedArray());
6922 buffer = i::JSTypedArray::cast(*obj)->GetBuffer(); 6922 buffer = i::JSTypedArray::cast(*obj)->GetBuffer();
6923 } 6923 }
6924 return Utils::ToLocal(buffer); 6924 return Utils::ToLocal(buffer);
6925 } 6925 }
6926 6926
6927 6927
6928 size_t v8::ArrayBufferView::CopyContents(void* dest, size_t byte_length) { 6928 size_t v8::ArrayBufferView::CopyContents(void* dest, size_t byte_length) {
6929 i::Handle<i::JSArrayBufferView> self = Utils::OpenHandle(this); 6929 i::Handle<i::JSArrayBufferView> self = Utils::OpenHandle(this);
6930 i::Isolate* isolate = self->GetIsolate(); 6930 size_t byte_offset = i::NumberToSize(self->byte_offset());
6931 size_t byte_offset = i::NumberToSize(isolate, self->byte_offset());
6932 size_t bytes_to_copy = 6931 size_t bytes_to_copy =
6933 i::Min(byte_length, i::NumberToSize(isolate, self->byte_length())); 6932 i::Min(byte_length, i::NumberToSize(self->byte_length()));
6934 if (bytes_to_copy) { 6933 if (bytes_to_copy) {
6935 i::DisallowHeapAllocation no_gc; 6934 i::DisallowHeapAllocation no_gc;
6936 i::Handle<i::JSArrayBuffer> buffer(i::JSArrayBuffer::cast(self->buffer())); 6935 i::Handle<i::JSArrayBuffer> buffer(i::JSArrayBuffer::cast(self->buffer()));
6937 const char* source = reinterpret_cast<char*>(buffer->backing_store()); 6936 const char* source = reinterpret_cast<char*>(buffer->backing_store());
6938 if (source == nullptr) { 6937 if (source == nullptr) {
6939 DCHECK(self->IsJSTypedArray()); 6938 DCHECK(self->IsJSTypedArray());
6940 i::Handle<i::JSTypedArray> typed_array(i::JSTypedArray::cast(*self)); 6939 i::Handle<i::JSTypedArray> typed_array(i::JSTypedArray::cast(*self));
6941 i::Handle<i::FixedTypedArrayBase> fixed_array( 6940 i::Handle<i::FixedTypedArrayBase> fixed_array(
6942 i::FixedTypedArrayBase::cast(typed_array->elements())); 6941 i::FixedTypedArrayBase::cast(typed_array->elements()));
6943 source = reinterpret_cast<char*>(fixed_array->DataPtr()); 6942 source = reinterpret_cast<char*>(fixed_array->DataPtr());
(...skipping 2045 matching lines...) Expand 10 before | Expand all | Expand 10 after
8989 Address callback_address = 8988 Address callback_address =
8990 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8989 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8991 VMState<EXTERNAL> state(isolate); 8990 VMState<EXTERNAL> state(isolate);
8992 ExternalCallbackScope call_scope(isolate, callback_address); 8991 ExternalCallbackScope call_scope(isolate, callback_address);
8993 callback(info); 8992 callback(info);
8994 } 8993 }
8995 8994
8996 8995
8997 } // namespace internal 8996 } // namespace internal
8998 } // namespace v8 8997 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins-arraybuffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698