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 6253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6264 i::Handle<i::Object> token_handle(security_token, isolate); | 6264 i::Handle<i::Object> token_handle(security_token, isolate); |
6265 return Utils::ToLocal(token_handle); | 6265 return Utils::ToLocal(token_handle); |
6266 } | 6266 } |
6267 | 6267 |
6268 | 6268 |
6269 v8::Isolate* Context::GetIsolate() { | 6269 v8::Isolate* Context::GetIsolate() { |
6270 i::Handle<i::Context> env = Utils::OpenHandle(this); | 6270 i::Handle<i::Context> env = Utils::OpenHandle(this); |
6271 return reinterpret_cast<Isolate*>(env->GetIsolate()); | 6271 return reinterpret_cast<Isolate*>(env->GetIsolate()); |
6272 } | 6272 } |
6273 | 6273 |
6274 | |
6275 v8::Local<v8::Object> Context::Global() { | 6274 v8::Local<v8::Object> Context::Global() { |
6276 i::Handle<i::Context> context = Utils::OpenHandle(this); | 6275 i::Handle<i::Context> context = Utils::OpenHandle(this); |
6277 i::Isolate* isolate = context->GetIsolate(); | 6276 i::Isolate* isolate = context->GetIsolate(); |
6278 i::Handle<i::Object> global(context->global_proxy(), isolate); | 6277 i::Handle<i::Object> global(context->global_proxy(), isolate); |
6279 // TODO(dcarney): This should always return the global proxy | 6278 // TODO(dcarney): This should always return the global proxy |
6280 // but can't presently as calls to GetProtoype will return the wrong result. | 6279 // but can't presently as calls to GetProtoype will return the wrong result. |
6281 if (i::Handle<i::JSGlobalProxy>::cast( | 6280 if (i::Handle<i::JSGlobalProxy>::cast( |
6282 global)->IsDetachedFrom(context->global_object())) { | 6281 global)->IsDetachedFrom(context->global_object())) { |
6283 global = i::Handle<i::Object>(context->global_object(), isolate); | 6282 global = i::Handle<i::Object>(context->global_object(), isolate); |
6284 } | 6283 } |
(...skipping 3543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9828 Address callback_address = | 9827 Address callback_address = |
9829 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9828 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9830 VMState<EXTERNAL> state(isolate); | 9829 VMState<EXTERNAL> state(isolate); |
9831 ExternalCallbackScope call_scope(isolate, callback_address); | 9830 ExternalCallbackScope call_scope(isolate, callback_address); |
9832 callback(info); | 9831 callback(info); |
9833 } | 9832 } |
9834 | 9833 |
9835 | 9834 |
9836 } // namespace internal | 9835 } // namespace internal |
9837 } // namespace v8 | 9836 } // namespace v8 |
OLD | NEW |