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 7087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7098 isolate->Enter(); | 7098 isolate->Enter(); |
7099 } | 7099 } |
7100 | 7100 |
7101 | 7101 |
7102 void Isolate::Exit() { | 7102 void Isolate::Exit() { |
7103 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7103 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
7104 isolate->Exit(); | 7104 isolate->Exit(); |
7105 } | 7105 } |
7106 | 7106 |
7107 | 7107 |
| 7108 void Isolate::SetAbortOnUncaughtExceptionCallback( |
| 7109 AbortOnUncaughtExceptionCallback callback) { |
| 7110 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 7111 isolate->SetAbortOnUncaughtExceptionCallback(callback); |
| 7112 } |
| 7113 |
| 7114 |
7108 Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope( | 7115 Isolate::DisallowJavascriptExecutionScope::DisallowJavascriptExecutionScope( |
7109 Isolate* isolate, | 7116 Isolate* isolate, |
7110 Isolate::DisallowJavascriptExecutionScope::OnFailure on_failure) | 7117 Isolate::DisallowJavascriptExecutionScope::OnFailure on_failure) |
7111 : on_failure_(on_failure) { | 7118 : on_failure_(on_failure) { |
7112 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 7119 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
7113 if (on_failure_ == CRASH_ON_FAILURE) { | 7120 if (on_failure_ == CRASH_ON_FAILURE) { |
7114 internal_ = reinterpret_cast<void*>( | 7121 internal_ = reinterpret_cast<void*>( |
7115 new i::DisallowJavascriptExecution(i_isolate)); | 7122 new i::DisallowJavascriptExecution(i_isolate)); |
7116 } else { | 7123 } else { |
7117 DCHECK_EQ(THROW_ON_FAILURE, on_failure); | 7124 DCHECK_EQ(THROW_ON_FAILURE, on_failure); |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8357 Address callback_address = | 8364 Address callback_address = |
8358 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8365 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8359 VMState<EXTERNAL> state(isolate); | 8366 VMState<EXTERNAL> state(isolate); |
8360 ExternalCallbackScope call_scope(isolate, callback_address); | 8367 ExternalCallbackScope call_scope(isolate, callback_address); |
8361 callback(info); | 8368 callback(info); |
8362 } | 8369 } |
8363 | 8370 |
8364 | 8371 |
8365 } // namespace internal | 8372 } // namespace internal |
8366 } // namespace v8 | 8373 } // namespace v8 |
OLD | NEW |