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/debug/debug-interface.h" | 5 #include "src/debug/debug-interface.h" |
6 #include "src/frames-inl.h" | 6 #include "src/frames-inl.h" |
7 #include "src/property-descriptor.h" | 7 #include "src/property-descriptor.h" |
8 #include "src/utils.h" | 8 #include "src/utils.h" |
9 #include "src/wasm/wasm-macro-gen.h" | 9 #include "src/wasm/wasm-macro-gen.h" |
10 #include "src/wasm/wasm-objects.h" | 10 #include "src/wasm/wasm-objects.h" |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 | 257 |
258 // return arg0 | 258 // return arg0 |
259 BUILD(runner, WASM_RETURN1(WASM_GET_LOCAL(0))); | 259 BUILD(runner, WASM_RETURN1(WASM_GET_LOCAL(0))); |
260 // for (int i = 0; i < 10; ++i) { f2(i); } | 260 // for (int i = 0; i < 10; ++i) { f2(i); } |
261 BUILD(f2, WASM_LOOP( | 261 BUILD(f2, WASM_LOOP( |
262 WASM_BR_IF(0, WASM_BINOP(kExprI32GeU, WASM_GET_LOCAL(0), | 262 WASM_BR_IF(0, WASM_BINOP(kExprI32GeU, WASM_GET_LOCAL(0), |
263 WASM_I32V_1(10))), | 263 WASM_I32V_1(10))), |
264 WASM_SET_LOCAL( | 264 WASM_SET_LOCAL( |
265 0, WASM_BINOP(kExprI32Sub, WASM_GET_LOCAL(0), WASM_ONE)), | 265 0, WASM_BINOP(kExprI32Sub, WASM_GET_LOCAL(0), WASM_ONE)), |
266 WASM_CALL_FUNCTION(runner.function_index(), WASM_GET_LOCAL(0)), | 266 WASM_CALL_FUNCTION(runner.function_index(), WASM_GET_LOCAL(0)), |
267 WASM_BR(1))); | 267 WASM_DROP, WASM_BR(1))); |
268 | 268 |
269 Isolate* isolate = runner.main_isolate(); | 269 Isolate* isolate = runner.main_isolate(); |
270 Handle<JSFunction> main_fun_wrapper = | 270 Handle<JSFunction> main_fun_wrapper = |
271 runner.module().WrapCode(f2.function_index()); | 271 runner.module().WrapCode(f2.function_index()); |
272 | 272 |
273 // Set first breakpoint on the GetLocal (offset 19) before the Call. | 273 // Set first breakpoint on the GetLocal (offset 19) before the Call. |
274 SetBreakpoint(runner, f2.function_index(), 19, 19); | 274 SetBreakpoint(runner, f2.function_index(), 19, 19); |
275 | 275 |
276 BreakHandler count_breaks(isolate, | 276 BreakHandler count_breaks(isolate, |
277 { | 277 { |
278 {19, BreakHandler::StepIn}, // GetLocal | 278 {19, BreakHandler::StepIn}, // GetLocal |
279 {21, BreakHandler::StepIn}, // Call | 279 {21, BreakHandler::StepIn}, // Call |
280 {1, BreakHandler::StepOut}, // in f2 | 280 {1, BreakHandler::StepOut}, // in f2 |
281 {23, BreakHandler::Continue} // After Call | 281 {23, BreakHandler::Continue} // After Call |
282 }); | 282 }); |
283 | 283 |
284 Handle<Object> global(isolate->context()->global_object(), isolate); | 284 Handle<Object> global(isolate->context()->global_object(), isolate); |
285 CHECK(!Execution::Call(isolate, main_fun_wrapper, global, 0, nullptr) | 285 CHECK(!Execution::Call(isolate, main_fun_wrapper, global, 0, nullptr) |
286 .is_null()); | 286 .is_null()); |
287 } | 287 } |
OLD | NEW |