Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Unified Diff: src/wasm/wasm-objects.cc

Issue 2587143002: [wasm] Add iterators for opcodes or offsets of one function (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/ast-decoder.h ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-objects.cc
diff --git a/src/wasm/wasm-objects.cc b/src/wasm/wasm-objects.cc
index f2d614e0f7e784f0f61bab598f6bd6c8e77f5b75..f7843adf8be6f9bfd06a56953088b62422ff5396 100644
--- a/src/wasm/wasm-objects.cc
+++ b/src/wasm/wasm-objects.cc
@@ -711,14 +711,14 @@ bool WasmCompiledModule::GetPossibleBreakpoints(
BytecodeIterator iterator(module_start + func.code_start_offset,
module_start + func.code_end_offset, &locals);
DCHECK_LT(0u, locals.decls_encoded_size);
- for (; iterator.has_next(); iterator.next()) {
- uint32_t offset = func.code_start_offset + iterator.pc_offset();
- if (offset >= end_offset) {
+ for (uint32_t offset : iterator.offsets()) {
+ uint32_t total_offset = func.code_start_offset + offset;
+ if (total_offset >= end_offset) {
DCHECK_EQ(end_func_index, func_idx);
break;
}
- if (offset < start_offset) continue;
- locations->push_back(v8::debug::Location(func_idx, iterator.pc_offset()));
+ if (total_offset < start_offset) continue;
+ locations->push_back(v8::debug::Location(func_idx, offset));
}
}
return true;
« no previous file with comments | « src/wasm/ast-decoder.h ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698