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

Side by Side Diff: src/api.cc

Issue 768543002: [WIP] TrapHandler 2014/11/27. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | « samples/shell.cc ('k') | src/base/platform/platform.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 5978 matching lines...) Expand 10 before | Expand all | Expand 10 after
5989 } 5989 }
5990 5990
5991 5991
5992 Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, void* data, 5992 Local<ArrayBuffer> v8::ArrayBuffer::New(Isolate* isolate, void* data,
5993 size_t byte_length) { 5993 size_t byte_length) {
5994 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); 5994 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
5995 LOG_API(i_isolate, "v8::ArrayBuffer::New(void*, size_t)"); 5995 LOG_API(i_isolate, "v8::ArrayBuffer::New(void*, size_t)");
5996 ENTER_V8(i_isolate); 5996 ENTER_V8(i_isolate);
5997 i::Handle<i::JSArrayBuffer> obj = 5997 i::Handle<i::JSArrayBuffer> obj =
5998 i_isolate->factory()->NewJSArrayBuffer(); 5998 i_isolate->factory()->NewJSArrayBuffer();
5999 i::Runtime::SetupArrayBuffer(i_isolate, obj, true, data, byte_length); 5999 i::Runtime::SetupArrayBuffer(i_isolate, obj, true, false, data, byte_length);
6000 return Utils::ToLocal(obj); 6000 return Utils::ToLocal(obj);
6001 } 6001 }
6002 6002
6003 6003
6004 Local<ArrayBuffer> v8::ArrayBufferView::Buffer() { 6004 Local<ArrayBuffer> v8::ArrayBufferView::Buffer() {
6005 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this); 6005 i::Handle<i::JSArrayBufferView> obj = Utils::OpenHandle(this);
6006 i::Handle<i::JSArrayBuffer> buffer; 6006 i::Handle<i::JSArrayBuffer> buffer;
6007 if (obj->IsJSDataView()) { 6007 if (obj->IsJSDataView()) {
6008 i::Handle<i::JSDataView> data_view(i::JSDataView::cast(*obj)); 6008 i::Handle<i::JSDataView> data_view(i::JSDataView::cast(*obj));
6009 DCHECK(data_view->buffer()->IsJSArrayBuffer()); 6009 DCHECK(data_view->buffer()->IsJSArrayBuffer());
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
7657 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7657 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7658 Address callback_address = 7658 Address callback_address =
7659 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7659 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7660 VMState<EXTERNAL> state(isolate); 7660 VMState<EXTERNAL> state(isolate);
7661 ExternalCallbackScope call_scope(isolate, callback_address); 7661 ExternalCallbackScope call_scope(isolate, callback_address);
7662 callback(info); 7662 callback(info);
7663 } 7663 }
7664 7664
7665 7665
7666 } } // namespace v8::internal 7666 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « samples/shell.cc ('k') | src/base/platform/platform.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698