| 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 5475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5486 | 5486 |
| 5487 | 5487 |
| 5488 void Context::DetachGlobal() { | 5488 void Context::DetachGlobal() { |
| 5489 i::Handle<i::Context> context = Utils::OpenHandle(this); | 5489 i::Handle<i::Context> context = Utils::OpenHandle(this); |
| 5490 i::Isolate* isolate = context->GetIsolate(); | 5490 i::Isolate* isolate = context->GetIsolate(); |
| 5491 ENTER_V8(isolate); | 5491 ENTER_V8(isolate); |
| 5492 isolate->bootstrapper()->DetachGlobal(context); | 5492 isolate->bootstrapper()->DetachGlobal(context); |
| 5493 } | 5493 } |
| 5494 | 5494 |
| 5495 | 5495 |
| 5496 MaybeLocal<v8::Object> Context::GetExtrasExportsObject() { |
| 5497 i::Handle<i::Context> context = Utils::OpenHandle(this); |
| 5498 i::Isolate* isolate = context->GetIsolate(); |
| 5499 i::Object* extras_exports = context->extras_exports_object(); |
| 5500 if (!extras_exports->IsJSObject()) return MaybeLocal<v8::Object>(); |
| 5501 i::Handle<i::JSObject> exports(i::JSObject::cast(extras_exports), isolate); |
| 5502 return Utils::ToLocal(exports); |
| 5503 } |
| 5504 |
| 5505 |
| 5496 void Context::AllowCodeGenerationFromStrings(bool allow) { | 5506 void Context::AllowCodeGenerationFromStrings(bool allow) { |
| 5497 i::Handle<i::Context> context = Utils::OpenHandle(this); | 5507 i::Handle<i::Context> context = Utils::OpenHandle(this); |
| 5498 i::Isolate* isolate = context->GetIsolate(); | 5508 i::Isolate* isolate = context->GetIsolate(); |
| 5499 ENTER_V8(isolate); | 5509 ENTER_V8(isolate); |
| 5500 context->set_allow_code_gen_from_strings( | 5510 context->set_allow_code_gen_from_strings( |
| 5501 allow ? isolate->heap()->true_value() : isolate->heap()->false_value()); | 5511 allow ? isolate->heap()->true_value() : isolate->heap()->false_value()); |
| 5502 } | 5512 } |
| 5503 | 5513 |
| 5504 | 5514 |
| 5505 bool Context::IsCodeGenerationFromStringsAllowed() { | 5515 bool Context::IsCodeGenerationFromStringsAllowed() { |
| (...skipping 2530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8036 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 8046 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 8037 Address callback_address = | 8047 Address callback_address = |
| 8038 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8048 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8039 VMState<EXTERNAL> state(isolate); | 8049 VMState<EXTERNAL> state(isolate); |
| 8040 ExternalCallbackScope call_scope(isolate, callback_address); | 8050 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8041 callback(info); | 8051 callback(info); |
| 8042 } | 8052 } |
| 8043 | 8053 |
| 8044 | 8054 |
| 8045 } } // namespace v8::internal | 8055 } } // namespace v8::internal |
| OLD | NEW |