OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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-macro-gen.h" | 5 #include "src/wasm/wasm-macro-gen.h" |
6 | 6 |
7 #include "test/cctest/cctest.h" | 7 #include "test/cctest/cctest.h" |
8 #include "test/cctest/compiler/value-helper.h" | 8 #include "test/cctest/compiler/value-helper.h" |
9 #include "test/cctest/wasm/test-signatures.h" | 9 #include "test/cctest/wasm/test-signatures.h" |
10 #include "test/cctest/wasm/wasm-run-utils.h" | 10 #include "test/cctest/wasm/wasm-run-utils.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 isolate->SetCaptureStackTraceForUncaughtExceptions(true, 10, | 82 isolate->SetCaptureStackTraceForUncaughtExceptions(true, 10, |
83 v8::StackTrace::kOverview); | 83 v8::StackTrace::kOverview); |
84 Handle<Object> global(isolate->context()->global_object(), isolate); | 84 Handle<Object> global(isolate->context()->global_object(), isolate); |
85 MaybeHandle<Object> maybe_exc; | 85 MaybeHandle<Object> maybe_exc; |
86 Handle<Object> args[] = {js_wasm_wrapper}; | 86 Handle<Object> args[] = {js_wasm_wrapper}; |
87 MaybeHandle<Object> returnObjMaybe = | 87 MaybeHandle<Object> returnObjMaybe = |
88 Execution::TryCall(isolate, js_trampoline, global, 1, args, &maybe_exc); | 88 Execution::TryCall(isolate, js_trampoline, global, 1, args, &maybe_exc); |
89 CHECK(returnObjMaybe.is_null()); | 89 CHECK(returnObjMaybe.is_null()); |
90 | 90 |
91 ExceptionInfo expected_exceptions[] = { | 91 ExceptionInfo expected_exceptions[] = { |
92 {"<WASM>", static_cast<int>(wasm_index), 1}, // -- | 92 {"<WASM UNNAMED>", static_cast<int>(wasm_index), 1}, // -- |
93 {"callFn", 1, 24} // -- | 93 {"callFn", 1, 24} // -- |
94 }; | 94 }; |
95 CheckExceptionInfos(isolate, maybe_exc.ToHandleChecked(), | 95 CheckExceptionInfos(isolate, maybe_exc.ToHandleChecked(), |
96 expected_exceptions); | 96 expected_exceptions); |
97 } | 97 } |
98 | 98 |
99 // Trigger a trap for loading from out-of-bounds. | 99 // Trigger a trap for loading from out-of-bounds. |
100 TEST(IllegalLoad) { | 100 TEST(IllegalLoad) { |
101 TestSignatures sigs; | 101 TestSignatures sigs; |
102 TestingModule module; | 102 TestingModule module; |
103 | 103 |
(...skipping 20 matching lines...) Expand all Loading... |
124 v8::StackTrace::kOverview); | 124 v8::StackTrace::kOverview); |
125 Handle<Object> global(isolate->context()->global_object(), isolate); | 125 Handle<Object> global(isolate->context()->global_object(), isolate); |
126 MaybeHandle<Object> maybe_exc; | 126 MaybeHandle<Object> maybe_exc; |
127 Handle<Object> args[] = {js_wasm_wrapper}; | 127 Handle<Object> args[] = {js_wasm_wrapper}; |
128 MaybeHandle<Object> returnObjMaybe = | 128 MaybeHandle<Object> returnObjMaybe = |
129 Execution::TryCall(isolate, js_trampoline, global, 1, args, &maybe_exc); | 129 Execution::TryCall(isolate, js_trampoline, global, 1, args, &maybe_exc); |
130 CHECK(returnObjMaybe.is_null()); | 130 CHECK(returnObjMaybe.is_null()); |
131 | 131 |
132 // Line number is 1-based, with 0 == kNoLineNumberInfo. | 132 // Line number is 1-based, with 0 == kNoLineNumberInfo. |
133 ExceptionInfo expected_exceptions[] = { | 133 ExceptionInfo expected_exceptions[] = { |
134 {"<WASM>", static_cast<int>(wasm_index), 6}, // -- | 134 {"<WASM UNNAMED>", static_cast<int>(wasm_index), 6}, // -- |
135 {"<WASM>", static_cast<int>(wasm_index_2), 2}, // -- | 135 {"<WASM UNNAMED>", static_cast<int>(wasm_index_2), 2}, // -- |
136 {"callFn", 1, 24} // -- | 136 {"callFn", 1, 24} // -- |
137 }; | 137 }; |
138 CheckExceptionInfos(isolate, maybe_exc.ToHandleChecked(), | 138 CheckExceptionInfos(isolate, maybe_exc.ToHandleChecked(), |
139 expected_exceptions); | 139 expected_exceptions); |
140 } | 140 } |
OLD | NEW |