| 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 6549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6560 } | 6560 } |
| 6561 | 6561 |
| 6562 | 6562 |
| 6563 Isolate* Isolate::GetCurrent() { | 6563 Isolate* Isolate::GetCurrent() { |
| 6564 i::Isolate* isolate = i::Isolate::Current(); | 6564 i::Isolate* isolate = i::Isolate::Current(); |
| 6565 return reinterpret_cast<Isolate*>(isolate); | 6565 return reinterpret_cast<Isolate*>(isolate); |
| 6566 } | 6566 } |
| 6567 | 6567 |
| 6568 | 6568 |
| 6569 Isolate* Isolate::New(const Isolate::CreateParams& params) { | 6569 Isolate* Isolate::New(const Isolate::CreateParams& params) { |
| 6570 // TODO(jochen): Remove again soon. |
| 6571 V8::Initialize(); |
| 6572 |
| 6570 i::Isolate* isolate = new i::Isolate(); | 6573 i::Isolate* isolate = new i::Isolate(); |
| 6571 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); | 6574 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); |
| 6572 if (params.entry_hook) { | 6575 if (params.entry_hook) { |
| 6573 isolate->set_function_entry_hook(params.entry_hook); | 6576 isolate->set_function_entry_hook(params.entry_hook); |
| 6574 } | 6577 } |
| 6575 if (params.code_event_handler) { | 6578 if (params.code_event_handler) { |
| 6576 isolate->InitializeLoggingAndCounters(); | 6579 isolate->InitializeLoggingAndCounters(); |
| 6577 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, | 6580 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, |
| 6578 params.code_event_handler); | 6581 params.code_event_handler); |
| 6579 } | 6582 } |
| (...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7655 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7658 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7656 Address callback_address = | 7659 Address callback_address = |
| 7657 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7660 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7658 VMState<EXTERNAL> state(isolate); | 7661 VMState<EXTERNAL> state(isolate); |
| 7659 ExternalCallbackScope call_scope(isolate, callback_address); | 7662 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7660 callback(info); | 7663 callback(info); |
| 7661 } | 7664 } |
| 7662 | 7665 |
| 7663 | 7666 |
| 7664 } } // namespace v8::internal | 7667 } } // namespace v8::internal |
| OLD | NEW |