| 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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 is_heap_oom | 392 is_heap_oom |
| 393 ? "Allocation failed - JavaScript heap out of memory" | 393 ? "Allocation failed - JavaScript heap out of memory" |
| 394 : "Allocation failed - process out of memory"); | 394 : "Allocation failed - process out of memory"); |
| 395 } | 395 } |
| 396 } else { | 396 } else { |
| 397 oom_callback(location, is_heap_oom); | 397 oom_callback(location, is_heap_oom); |
| 398 } | 398 } |
| 399 isolate->SignalFatalError(); | 399 isolate->SignalFatalError(); |
| 400 } | 400 } |
| 401 | 401 |
| 402 void Utils::ReportAsmJsWarning(i::Handle<i::JSMessageObject> message) { |
| 403 i::Isolate* isolate = i::Isolate::Current(); |
| 404 AsmJsWarningCallback asmjs_warning_callback = |
| 405 isolate->asmjs_warning_behavior(); |
| 406 if (asmjs_warning_callback == nullptr) { |
| 407 v8::internal::PrintF( |
| 408 "%s\n", i::MessageHandler::GetLocalizedMessage(isolate, message).get()); |
| 409 } else { |
| 410 asmjs_warning_callback(MessageToLocal(message)); |
| 411 } |
| 412 } |
| 413 |
| 402 static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) { | 414 static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) { |
| 403 if (isolate->has_scheduled_exception()) { | 415 if (isolate->has_scheduled_exception()) { |
| 404 return isolate->scheduled_exception() == | 416 return isolate->scheduled_exception() == |
| 405 isolate->heap()->termination_exception(); | 417 isolate->heap()->termination_exception(); |
| 406 } | 418 } |
| 407 return false; | 419 return false; |
| 408 } | 420 } |
| 409 | 421 |
| 410 | 422 |
| 411 void V8::SetNativesDataBlob(StartupData* natives_blob) { | 423 void V8::SetNativesDataBlob(StartupData* natives_blob) { |
| (...skipping 8005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8417 void Isolate::SetFatalErrorHandler(FatalErrorCallback that) { | 8429 void Isolate::SetFatalErrorHandler(FatalErrorCallback that) { |
| 8418 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8430 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8419 isolate->set_exception_behavior(that); | 8431 isolate->set_exception_behavior(that); |
| 8420 } | 8432 } |
| 8421 | 8433 |
| 8422 void Isolate::SetOOMErrorHandler(OOMErrorCallback that) { | 8434 void Isolate::SetOOMErrorHandler(OOMErrorCallback that) { |
| 8423 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8435 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8424 isolate->set_oom_behavior(that); | 8436 isolate->set_oom_behavior(that); |
| 8425 } | 8437 } |
| 8426 | 8438 |
| 8439 void Isolate::SetAsmJsWarningHandler(AsmJsWarningCallback that) { |
| 8440 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8441 isolate->set_asmjs_warning_behavior(that); |
| 8442 } |
| 8443 |
| 8427 void Isolate::SetAllowCodeGenerationFromStringsCallback( | 8444 void Isolate::SetAllowCodeGenerationFromStringsCallback( |
| 8428 AllowCodeGenerationFromStringsCallback callback) { | 8445 AllowCodeGenerationFromStringsCallback callback) { |
| 8429 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8446 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8430 isolate->set_allow_code_gen_callback(callback); | 8447 isolate->set_allow_code_gen_callback(callback); |
| 8431 } | 8448 } |
| 8432 | 8449 |
| 8433 | 8450 |
| 8434 bool Isolate::IsDead() { | 8451 bool Isolate::IsDead() { |
| 8435 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8452 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8436 return isolate->IsDead(); | 8453 return isolate->IsDead(); |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9854 Address callback_address = | 9871 Address callback_address = |
| 9855 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9872 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9856 VMState<EXTERNAL> state(isolate); | 9873 VMState<EXTERNAL> state(isolate); |
| 9857 ExternalCallbackScope call_scope(isolate, callback_address); | 9874 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9858 callback(info); | 9875 callback(info); |
| 9859 } | 9876 } |
| 9860 | 9877 |
| 9861 | 9878 |
| 9862 } // namespace internal | 9879 } // namespace internal |
| 9863 } // namespace v8 | 9880 } // namespace v8 |
| OLD | NEW |