| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 FOR_UINT32_INPUTS(a) { | 195 FOR_UINT32_INPUTS(a) { |
| 196 for (uint32_t b = 11; b < 3000000000u; b += 1000000000u) { | 196 for (uint32_t b = 11; b < 3000000000u; b += 1000000000u) { |
| 197 thread->Reset(); | 197 thread->Reset(); |
| 198 WasmVal args[] = {WasmVal(*a), WasmVal(b)}; | 198 WasmVal args[] = {WasmVal(*a), WasmVal(b)}; |
| 199 thread->PushFrame(r.function(), args); | 199 thread->PushFrame(r.function(), args); |
| 200 | 200 |
| 201 for (int i = 0; i < kNumBreakpoints; i++) { | 201 for (int i = 0; i < kNumBreakpoints; i++) { |
| 202 thread->Run(); // run to next breakpoint | 202 thread->Run(); // run to next breakpoint |
| 203 // Check the thread stopped at the right pc. | 203 // Check the thread stopped at the right pc. |
| 204 CHECK_EQ(WasmInterpreter::PAUSED, thread->state()); | 204 CHECK_EQ(WasmInterpreter::PAUSED, thread->state()); |
| 205 CHECK_EQ(kLocalsDeclSize + offsets[i], thread->GetBreakpointPc()); | 205 CHECK_EQ(static_cast<size_t>(kLocalsDeclSize + offsets[i]), |
| 206 thread->GetBreakpointPc()); |
| 206 } | 207 } |
| 207 | 208 |
| 208 thread->Run(); // run to completion | 209 thread->Run(); // run to completion |
| 209 | 210 |
| 210 // Check the thread finished with the right value. | 211 // Check the thread finished with the right value. |
| 211 CHECK_EQ(WasmInterpreter::FINISHED, thread->state()); | 212 CHECK_EQ(WasmInterpreter::FINISHED, thread->state()); |
| 212 uint32_t expected = (*a) + (b); | 213 uint32_t expected = (*a) + (b); |
| 213 CHECK_EQ(expected, thread->GetReturnValue().to<uint32_t>()); | 214 CHECK_EQ(expected, thread->GetReturnValue().to<uint32_t>()); |
| 214 } | 215 } |
| 215 } | 216 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 interpreter->SetBreakpoint(r.function(), kLocalsDeclSize + offsets[0], | 274 interpreter->SetBreakpoint(r.function(), kLocalsDeclSize + offsets[0], |
| 274 do_break); | 275 do_break); |
| 275 thread->Reset(); | 276 thread->Reset(); |
| 276 WasmVal args[] = {WasmVal(*a), WasmVal(b)}; | 277 WasmVal args[] = {WasmVal(*a), WasmVal(b)}; |
| 277 thread->PushFrame(r.function(), args); | 278 thread->PushFrame(r.function(), args); |
| 278 | 279 |
| 279 if (do_break) { | 280 if (do_break) { |
| 280 thread->Run(); // run to next breakpoint | 281 thread->Run(); // run to next breakpoint |
| 281 // Check the thread stopped at the right pc. | 282 // Check the thread stopped at the right pc. |
| 282 CHECK_EQ(WasmInterpreter::PAUSED, thread->state()); | 283 CHECK_EQ(WasmInterpreter::PAUSED, thread->state()); |
| 283 CHECK_EQ(kLocalsDeclSize + offsets[0], thread->GetBreakpointPc()); | 284 CHECK_EQ(static_cast<size_t>(kLocalsDeclSize + offsets[0]), |
| 285 thread->GetBreakpointPc()); |
| 284 } | 286 } |
| 285 | 287 |
| 286 thread->Run(); // run to completion | 288 thread->Run(); // run to completion |
| 287 | 289 |
| 288 // Check the thread finished with the right value. | 290 // Check the thread finished with the right value. |
| 289 CHECK_EQ(WasmInterpreter::FINISHED, thread->state()); | 291 CHECK_EQ(WasmInterpreter::FINISHED, thread->state()); |
| 290 uint32_t expected = (*a) & (b); | 292 uint32_t expected = (*a) & (b); |
| 291 CHECK_EQ(expected, thread->GetReturnValue().to<uint32_t>()); | 293 CHECK_EQ(expected, thread->GetReturnValue().to<uint32_t>()); |
| 292 } | 294 } |
| 293 } | 295 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 BUILD(r, WASM_F64_MUL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 397 BUILD(r, WASM_F64_MUL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
| 396 r.Call(1048575.5, 2.5); | 398 r.Call(1048575.5, 2.5); |
| 397 CHECK(!r.possible_nondeterminism()); | 399 CHECK(!r.possible_nondeterminism()); |
| 398 r.Call(std::numeric_limits<double>::infinity(), 0.0); | 400 r.Call(std::numeric_limits<double>::infinity(), 0.0); |
| 399 CHECK(r.possible_nondeterminism()); | 401 CHECK(r.possible_nondeterminism()); |
| 400 } | 402 } |
| 401 } | 403 } |
| 402 } // namespace wasm | 404 } // namespace wasm |
| 403 } // namespace internal | 405 } // namespace internal |
| 404 } // namespace v8 | 406 } // namespace v8 |
| OLD | NEW |