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