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 | |
6573 i::Isolate* isolate = new i::Isolate(); | 6570 i::Isolate* isolate = new i::Isolate(); |
6574 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); | 6571 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); |
6575 if (params.entry_hook) { | 6572 if (params.entry_hook) { |
6576 isolate->set_function_entry_hook(params.entry_hook); | 6573 isolate->set_function_entry_hook(params.entry_hook); |
6577 } | 6574 } |
6578 if (params.code_event_handler) { | 6575 if (params.code_event_handler) { |
6579 isolate->InitializeLoggingAndCounters(); | 6576 isolate->InitializeLoggingAndCounters(); |
6580 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, | 6577 isolate->logger()->SetCodeEventHandler(kJitCodeEventDefault, |
6581 params.code_event_handler); | 6578 params.code_event_handler); |
6582 } | 6579 } |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7658 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7655 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7659 Address callback_address = | 7656 Address callback_address = |
7660 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7657 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7661 VMState<EXTERNAL> state(isolate); | 7658 VMState<EXTERNAL> state(isolate); |
7662 ExternalCallbackScope call_scope(isolate, callback_address); | 7659 ExternalCallbackScope call_scope(isolate, callback_address); |
7663 callback(info); | 7660 callback(info); |
7664 } | 7661 } |
7665 | 7662 |
7666 | 7663 |
7667 } } // namespace v8::internal | 7664 } } // namespace v8::internal |
OLD | NEW |