Chromium Code Reviews| 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 if (i::FLAG_disable_asm_warnings) { | |
|
Benedikt Meurer
2016/11/23 08:41:31
Is this flag really useful? If you don't want the
bradn
2016/11/23 08:46:18
machenbach, how is the correctness fuzzer set up?
Michael Achenbach
2016/11/23 09:01:22
It runs d8. But maybe already https://codereview.c
bradn
2016/11/23 09:10:55
Ok.
Dropped until we know we need it.
| |
| 404 return; | |
| 405 } | |
| 406 i::Isolate* isolate = i::Isolate::Current(); | |
| 407 AsmJsWarningCallback asmjs_warning_callback = | |
| 408 isolate->asmjs_warning_behavior(); | |
| 409 if (asmjs_warning_callback == nullptr) { | |
| 410 v8::internal::PrintF( | |
| 411 "%s\n", i::MessageHandler::GetLocalizedMessage(isolate, message).get()); | |
| 412 } else { | |
| 413 asmjs_warning_callback(MessageToLocal(message)); | |
| 414 } | |
| 415 } | |
| 416 | |
| 402 static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) { | 417 static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) { |
| 403 if (isolate->has_scheduled_exception()) { | 418 if (isolate->has_scheduled_exception()) { |
| 404 return isolate->scheduled_exception() == | 419 return isolate->scheduled_exception() == |
| 405 isolate->heap()->termination_exception(); | 420 isolate->heap()->termination_exception(); |
| 406 } | 421 } |
| 407 return false; | 422 return false; |
| 408 } | 423 } |
| 409 | 424 |
| 410 | 425 |
| 411 void V8::SetNativesDataBlob(StartupData* natives_blob) { | 426 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) { | 8432 void Isolate::SetFatalErrorHandler(FatalErrorCallback that) { |
| 8418 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8433 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8419 isolate->set_exception_behavior(that); | 8434 isolate->set_exception_behavior(that); |
| 8420 } | 8435 } |
| 8421 | 8436 |
| 8422 void Isolate::SetOOMErrorHandler(OOMErrorCallback that) { | 8437 void Isolate::SetOOMErrorHandler(OOMErrorCallback that) { |
| 8423 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8438 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8424 isolate->set_oom_behavior(that); | 8439 isolate->set_oom_behavior(that); |
| 8425 } | 8440 } |
| 8426 | 8441 |
| 8442 void Isolate::SetAsmJsWarningHandler(AsmJsWarningCallback that) { | |
| 8443 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | |
| 8444 isolate->set_asmjs_warning_behavior(that); | |
| 8445 } | |
| 8446 | |
| 8427 void Isolate::SetAllowCodeGenerationFromStringsCallback( | 8447 void Isolate::SetAllowCodeGenerationFromStringsCallback( |
| 8428 AllowCodeGenerationFromStringsCallback callback) { | 8448 AllowCodeGenerationFromStringsCallback callback) { |
| 8429 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8449 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8430 isolate->set_allow_code_gen_callback(callback); | 8450 isolate->set_allow_code_gen_callback(callback); |
| 8431 } | 8451 } |
| 8432 | 8452 |
| 8433 | 8453 |
| 8434 bool Isolate::IsDead() { | 8454 bool Isolate::IsDead() { |
| 8435 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 8455 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 8436 return isolate->IsDead(); | 8456 return isolate->IsDead(); |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9854 Address callback_address = | 9874 Address callback_address = |
| 9855 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9875 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9856 VMState<EXTERNAL> state(isolate); | 9876 VMState<EXTERNAL> state(isolate); |
| 9857 ExternalCallbackScope call_scope(isolate, callback_address); | 9877 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9858 callback(info); | 9878 callback(info); |
| 9859 } | 9879 } |
| 9860 | 9880 |
| 9861 | 9881 |
| 9862 } // namespace internal | 9882 } // namespace internal |
| 9863 } // namespace v8 | 9883 } // namespace v8 |
| OLD | NEW |