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

Side by Side Diff: src/api.cc

Issue 1094863002: Remove the weak list of views from array buffers (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 unified diff | Download patch
« no previous file with comments | « src/accessors.cc ('k') | src/elements.h » ('j') | src/heap/heap.h » ('J')
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 6322 matching lines...) Expand 10 before | Expand all | Expand 10 after
6333 if (typed_array->buffer()->IsSmi()) { 6333 if (typed_array->buffer()->IsSmi()) {
6334 i::Handle<i::FixedTypedArrayBase> fixed_array( 6334 i::Handle<i::FixedTypedArrayBase> fixed_array(
6335 i::FixedTypedArrayBase::cast(typed_array->elements())); 6335 i::FixedTypedArrayBase::cast(typed_array->elements()));
6336 source = reinterpret_cast<char*>(fixed_array->DataPtr()); 6336 source = reinterpret_cast<char*>(fixed_array->DataPtr());
6337 } else { 6337 } else {
6338 i::Handle<i::JSArrayBuffer> buffer( 6338 i::Handle<i::JSArrayBuffer> buffer(
6339 i::JSArrayBuffer::cast(typed_array->buffer())); 6339 i::JSArrayBuffer::cast(typed_array->buffer()));
6340 source = reinterpret_cast<char*>(buffer->backing_store()); 6340 source = reinterpret_cast<char*>(buffer->backing_store());
6341 } 6341 }
6342 } 6342 }
6343 if (!source) return 0;
Hannes Payer (out of office) 2015/04/22 07:45:53 Isn't that more an assert? source is not null when
jochen (gone - plz use gerrit) 2015/04/22 08:21:42 true. if it's neutered, byte_length() above will b
6343 memcpy(dest, source + byte_offset, bytes_to_copy); 6344 memcpy(dest, source + byte_offset, bytes_to_copy);
6344 } 6345 }
6345 return bytes_to_copy; 6346 return bytes_to_copy;
6346 } 6347 }
6347 6348
6348 6349
6349 bool v8::ArrayBufferView::HasBuffer() const { 6350 bool v8::ArrayBufferView::HasBuffer() const {
6350 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this); 6351 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
6351 if (obj->IsJSDataView()) return true; 6352 if (obj->IsJSDataView()) return true;
6352 DCHECK(obj->IsJSTypedArray()); 6353 DCHECK(obj->IsJSTypedArray());
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after
8009 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8010 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8010 Address callback_address = 8011 Address callback_address =
8011 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8012 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8012 VMState<EXTERNAL> state(isolate); 8013 VMState<EXTERNAL> state(isolate);
8013 ExternalCallbackScope call_scope(isolate, callback_address); 8014 ExternalCallbackScope call_scope(isolate, callback_address);
8014 callback(info); 8015 callback(info);
8015 } 8016 }
8016 8017
8017 8018
8018 } } // namespace v8::internal 8019 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | src/elements.h » ('j') | src/heap/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698