| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "v8/include/v8-debug.h" | 69 #include "v8/include/v8-debug.h" |
| 70 #include "v8/include/v8-profiler.h" | 70 #include "v8/include/v8-profiler.h" |
| 71 | 71 |
| 72 namespace blink { | 72 namespace blink { |
| 73 | 73 |
| 74 static void ReportFatalErrorInMainThread(const char* location, | 74 static void ReportFatalErrorInMainThread(const char* location, |
| 75 const char* message) { | 75 const char* message) { |
| 76 int memory_usage_mb = Platform::Current()->ActualMemoryUsageMB(); | 76 int memory_usage_mb = Platform::Current()->ActualMemoryUsageMB(); |
| 77 DVLOG(1) << "V8 error: " << message << " (" << location | 77 DVLOG(1) << "V8 error: " << message << " (" << location |
| 78 << "). Current memory usage: " << memory_usage_mb << " MB"; | 78 << "). Current memory usage: " << memory_usage_mb << " MB"; |
| 79 LOG(FATAL); | 79 IMMEDIATE_CRASH(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 static void ReportOOMErrorInMainThread(const char* location, bool is_js_heap) { | 82 static void ReportOOMErrorInMainThread(const char* location, bool is_js_heap) { |
| 83 int memory_usage_mb = Platform::Current()->ActualMemoryUsageMB(); | 83 int memory_usage_mb = Platform::Current()->ActualMemoryUsageMB(); |
| 84 DVLOG(1) << "V8 " << (is_js_heap ? "javascript" : "process") << " OOM: (" | 84 DVLOG(1) << "V8 " << (is_js_heap ? "javascript" : "process") << " OOM: (" |
| 85 << location << "). Current memory usage: " << memory_usage_mb | 85 << location << "). Current memory usage: " << memory_usage_mb |
| 86 << " MB"; | 86 << " MB"; |
| 87 OOM_CRASH(); | 87 OOM_CRASH(); |
| 88 } | 88 } |
| 89 | 89 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 v8::Isolate::kMessageLog); | 558 v8::Isolate::kMessageLog); |
| 559 isolate->SetFatalErrorHandler(ReportFatalErrorInWorker); | 559 isolate->SetFatalErrorHandler(ReportFatalErrorInWorker); |
| 560 | 560 |
| 561 uint32_t here; | 561 uint32_t here; |
| 562 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - | 562 isolate->SetStackLimit(reinterpret_cast<uintptr_t>(&here) - |
| 563 kWorkerMaxStackSize); | 563 kWorkerMaxStackSize); |
| 564 isolate->SetPromiseRejectCallback(PromiseRejectHandlerInWorker); | 564 isolate->SetPromiseRejectCallback(PromiseRejectHandlerInWorker); |
| 565 } | 565 } |
| 566 | 566 |
| 567 } // namespace blink | 567 } // namespace blink |
| OLD | NEW |