OLD | NEW |
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 6222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6233 Local<Context> v8::Context::New(v8::Isolate* external_isolate, | 6233 Local<Context> v8::Context::New(v8::Isolate* external_isolate, |
6234 v8::ExtensionConfiguration* extensions, | 6234 v8::ExtensionConfiguration* extensions, |
6235 v8::MaybeLocal<ObjectTemplate> global_template, | 6235 v8::MaybeLocal<ObjectTemplate> global_template, |
6236 v8::MaybeLocal<Value> global_object) { | 6236 v8::MaybeLocal<Value> global_object) { |
6237 return NewContext(external_isolate, extensions, global_template, | 6237 return NewContext(external_isolate, extensions, global_template, |
6238 global_object, 0); | 6238 global_object, 0); |
6239 } | 6239 } |
6240 | 6240 |
6241 MaybeLocal<Context> v8::Context::FromSnapshot( | 6241 MaybeLocal<Context> v8::Context::FromSnapshot( |
6242 v8::Isolate* external_isolate, size_t context_snapshot_index, | 6242 v8::Isolate* external_isolate, size_t context_snapshot_index, |
6243 v8::ExtensionConfiguration* extensions) { | 6243 v8::ExtensionConfiguration* extensions, MaybeLocal<Value> global_object) { |
6244 size_t index_including_default_context = context_snapshot_index + 1; | 6244 size_t index_including_default_context = context_snapshot_index + 1; |
6245 if (!i::Snapshot::HasContextSnapshot( | 6245 if (!i::Snapshot::HasContextSnapshot( |
6246 reinterpret_cast<i::Isolate*>(external_isolate), | 6246 reinterpret_cast<i::Isolate*>(external_isolate), |
6247 index_including_default_context)) { | 6247 index_including_default_context)) { |
6248 return MaybeLocal<Context>(); | 6248 return MaybeLocal<Context>(); |
6249 } | 6249 } |
6250 return NewContext(external_isolate, extensions, MaybeLocal<ObjectTemplate>(), | 6250 return NewContext(external_isolate, extensions, MaybeLocal<ObjectTemplate>(), |
6251 MaybeLocal<Value>(), index_including_default_context); | 6251 global_object, index_including_default_context); |
6252 } | 6252 } |
6253 | 6253 |
6254 MaybeLocal<Object> v8::Context::NewRemoteContext( | 6254 MaybeLocal<Object> v8::Context::NewRemoteContext( |
6255 v8::Isolate* external_isolate, v8::Local<ObjectTemplate> global_template, | 6255 v8::Isolate* external_isolate, v8::Local<ObjectTemplate> global_template, |
6256 v8::MaybeLocal<v8::Value> global_object) { | 6256 v8::MaybeLocal<v8::Value> global_object) { |
6257 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); | 6257 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); |
6258 LOG_API(isolate, Context, NewRemoteContext); | 6258 LOG_API(isolate, Context, NewRemoteContext); |
6259 i::HandleScope scope(isolate); | 6259 i::HandleScope scope(isolate); |
6260 i::Handle<i::FunctionTemplateInfo> global_constructor = | 6260 i::Handle<i::FunctionTemplateInfo> global_constructor = |
6261 EnsureConstructor(isolate, *global_template); | 6261 EnsureConstructor(isolate, *global_template); |
(...skipping 3616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9878 Address callback_address = | 9878 Address callback_address = |
9879 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9879 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9880 VMState<EXTERNAL> state(isolate); | 9880 VMState<EXTERNAL> state(isolate); |
9881 ExternalCallbackScope call_scope(isolate, callback_address); | 9881 ExternalCallbackScope call_scope(isolate, callback_address); |
9882 callback(info); | 9882 callback(info); |
9883 } | 9883 } |
9884 | 9884 |
9885 | 9885 |
9886 } // namespace internal | 9886 } // namespace internal |
9887 } // namespace v8 | 9887 } // namespace v8 |
OLD | NEW |