OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/wasm/wasm-result.h" | 5 #include "src/wasm/wasm-result.h" |
6 | 6 |
7 #include "src/factory.h" | 7 #include "src/factory.h" |
8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void ErrorThrower::RangeError(const char* format, ...) { | 57 void ErrorThrower::RangeError(const char* format, ...) { |
58 if (error()) return; | 58 if (error()) return; |
59 va_list arguments; | 59 va_list arguments; |
60 va_start(arguments, format); | 60 va_start(arguments, format); |
61 Format(isolate_->range_error_function(), format, arguments); | 61 Format(isolate_->range_error_function(), format, arguments); |
62 va_end(arguments); | 62 va_end(arguments); |
63 } | 63 } |
64 | 64 |
65 void ErrorThrower::CompileError(const char* format, ...) { | 65 void ErrorThrower::CompileError(const char* format, ...) { |
66 if (error()) return; | 66 if (error()) return; |
| 67 wasm_error_ = true; |
67 va_list arguments; | 68 va_list arguments; |
68 va_start(arguments, format); | 69 va_start(arguments, format); |
69 Format(isolate_->wasm_compile_error_function(), format, arguments); | 70 Format(isolate_->wasm_compile_error_function(), format, arguments); |
70 va_end(arguments); | 71 va_end(arguments); |
71 } | 72 } |
72 | 73 |
73 void ErrorThrower::LinkError(const char* format, ...) { | 74 void ErrorThrower::LinkError(const char* format, ...) { |
74 if (error()) return; | 75 if (error()) return; |
| 76 wasm_error_ = true; |
75 va_list arguments; | 77 va_list arguments; |
76 va_start(arguments, format); | 78 va_start(arguments, format); |
77 Format(isolate_->wasm_link_error_function(), format, arguments); | 79 Format(isolate_->wasm_link_error_function(), format, arguments); |
78 va_end(arguments); | 80 va_end(arguments); |
79 } | 81 } |
80 | 82 |
81 void ErrorThrower::RuntimeError(const char* format, ...) { | 83 void ErrorThrower::RuntimeError(const char* format, ...) { |
82 if (error()) return; | 84 if (error()) return; |
| 85 wasm_error_ = true; |
83 va_list arguments; | 86 va_list arguments; |
84 va_start(arguments, format); | 87 va_start(arguments, format); |
85 Format(isolate_->wasm_runtime_error_function(), format, arguments); | 88 Format(isolate_->wasm_runtime_error_function(), format, arguments); |
86 va_end(arguments); | 89 va_end(arguments); |
87 } | 90 } |
88 | 91 |
89 ErrorThrower::~ErrorThrower() { | 92 ErrorThrower::~ErrorThrower() { |
90 if (error() && !isolate_->has_pending_exception()) { | 93 if (error() && !isolate_->has_pending_exception()) { |
91 isolate_->ScheduleThrow(*exception_); | 94 isolate_->ScheduleThrow(*exception_); |
92 } | 95 } |
93 } | 96 } |
94 } // namespace wasm | 97 } // namespace wasm |
95 } // namespace internal | 98 } // namespace internal |
96 } // namespace v8 | 99 } // namespace v8 |
OLD | NEW |