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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 va_list arguments; | 67 va_list arguments; |
68 va_start(arguments, format); | 68 va_start(arguments, format); |
69 Format(isolate_->wasm_compile_error_function(), format, arguments); | 69 Format(isolate_->wasm_compile_error_function(), format, arguments); |
70 va_end(arguments); | 70 va_end(arguments); |
71 } | 71 } |
72 | 72 |
| 73 void ErrorThrower::LinkError(const char* format, ...) { |
| 74 if (error()) return; |
| 75 va_list arguments; |
| 76 va_start(arguments, format); |
| 77 Format(isolate_->wasm_link_error_function(), format, arguments); |
| 78 va_end(arguments); |
| 79 } |
| 80 |
73 void ErrorThrower::RuntimeError(const char* format, ...) { | 81 void ErrorThrower::RuntimeError(const char* format, ...) { |
74 if (error()) return; | 82 if (error()) return; |
75 va_list arguments; | 83 va_list arguments; |
76 va_start(arguments, format); | 84 va_start(arguments, format); |
77 Format(isolate_->wasm_runtime_error_function(), format, arguments); | 85 Format(isolate_->wasm_runtime_error_function(), format, arguments); |
78 va_end(arguments); | 86 va_end(arguments); |
79 } | 87 } |
80 | 88 |
81 ErrorThrower::~ErrorThrower() { | 89 ErrorThrower::~ErrorThrower() { |
82 if (error() && !isolate_->has_pending_exception()) { | 90 if (error() && !isolate_->has_pending_exception()) { |
83 isolate_->ScheduleThrow(*exception_); | 91 isolate_->ScheduleThrow(*exception_); |
84 } | 92 } |
85 } | 93 } |
86 } // namespace wasm | 94 } // namespace wasm |
87 } // namespace internal | 95 } // namespace internal |
88 } // namespace v8 | 96 } // namespace v8 |
OLD | NEW |