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

Side by Side Diff: src/api.cc

Issue 1188313006: Version 4.4.63.8 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.4
Patch Set: Created 5 years, 6 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 | « include/v8-version.h ('k') | src/heap/heap.h » ('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 6240 matching lines...) Expand 10 before | Expand all | Expand 10 after
6251 return Utils::OpenHandle(this)->is_neuterable(); 6251 return Utils::OpenHandle(this)->is_neuterable();
6252 } 6252 }
6253 6253
6254 6254
6255 v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() { 6255 v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() {
6256 i::Handle<i::JSArrayBuffer> self = Utils::OpenHandle(this); 6256 i::Handle<i::JSArrayBuffer> self = Utils::OpenHandle(this);
6257 i::Isolate* isolate = self->GetIsolate(); 6257 i::Isolate* isolate = self->GetIsolate();
6258 Utils::ApiCheck(!self->is_external(), "v8::ArrayBuffer::Externalize", 6258 Utils::ApiCheck(!self->is_external(), "v8::ArrayBuffer::Externalize",
6259 "ArrayBuffer already externalized"); 6259 "ArrayBuffer already externalized");
6260 self->set_is_external(true); 6260 self->set_is_external(true);
6261 isolate->heap()->UnregisterArrayBuffer(self->backing_store()); 6261 isolate->heap()->UnregisterArrayBuffer(isolate->heap()->InNewSpace(*self),
6262 self->backing_store());
6262 6263
6263 return GetContents(); 6264 return GetContents();
6264 } 6265 }
6265 6266
6266 6267
6267 v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents() { 6268 v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents() {
6268 i::Handle<i::JSArrayBuffer> self = Utils::OpenHandle(this); 6269 i::Handle<i::JSArrayBuffer> self = Utils::OpenHandle(this);
6269 size_t byte_length = static_cast<size_t>(self->byte_length()->Number()); 6270 size_t byte_length = static_cast<size_t>(self->byte_length()->Number());
6270 Contents contents; 6271 Contents contents;
6271 contents.data_ = self->backing_store(); 6272 contents.data_ = self->backing_store();
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after
8031 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 8032 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
8032 Address callback_address = 8033 Address callback_address =
8033 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8034 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8034 VMState<EXTERNAL> state(isolate); 8035 VMState<EXTERNAL> state(isolate);
8035 ExternalCallbackScope call_scope(isolate, callback_address); 8036 ExternalCallbackScope call_scope(isolate, callback_address);
8036 callback(info); 8037 callback(info);
8037 } 8038 }
8038 8039
8039 8040
8040 } } // namespace v8::internal 8041 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698