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

Unified Diff: src/compiler/wasm-compiler.h

Issue 1890803002: [wasm] Generate source position information (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-throw-error
Patch Set: some doc and fixes Created 4 years, 8 months 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
Index: src/compiler/wasm-compiler.h
diff --git a/src/compiler/wasm-compiler.h b/src/compiler/wasm-compiler.h
index 4a4b1a7cd04ba05f638bbe7a35879364a926fbcd..1b46f37ff01ceed396371a112f6815d3de4f017d 100644
--- a/src/compiler/wasm-compiler.h
+++ b/src/compiler/wasm-compiler.h
@@ -18,6 +18,8 @@ namespace compiler {
class Node;
class JSGraph;
class Graph;
+class SourcePositionTable;
+class SourcePositionScope;
}
namespace wasm {
@@ -55,7 +57,14 @@ Handle<JSFunction> CompileJSToWasmWrapper(
class WasmTrapHelper;
class WasmGraphBuilder {
public:
- WasmGraphBuilder(Zone* z, JSGraph* g, wasm::FunctionSig* function_signature);
+ WasmGraphBuilder(
+ Zone* z, JSGraph* g, wasm::FunctionSig* function_signature,
+ compiler::SourcePositionTable* source_position_table = nullptr);
+
+ ~WasmGraphBuilder() {
+ // check that Enter- / LeaveSourcePositionScope is balanced
+ DCHECK_NULL(source_position_scope_);
+ }
Node** Buffer(size_t count) {
if (count > cur_bufsize_) {
@@ -141,6 +150,18 @@ class WasmGraphBuilder {
void Int64LoweringForTesting();
+ // Register a graph decorator to assign source positions to nodes (in
titzer 2016/04/18 11:03:51 I don't think we should add scoping for this. I th
Clemens Hammacher 2016/04/18 11:18:10 What about step-through debugging? Wouldn't that r
+ // source_position_table_). Only has an effect if source_position_table_ is
+ // non-null. Ensure to call LeaveSourcePositionScope afterwards.
+ void EnterSourcePositionScope();
+ void LeaveSourcePositionScope();
+
+ // Set current source position, such that all nodes created after this call
+ // get the respecitve position assigned. This only has an effect if
+ // source_position_table_ is non-null and EnterSourcePositionScope was called
+ // before.
+ void SetCurrentSourcePosition(int position);
+
private:
static const int kDefaultBufferSize = 16;
friend class WasmTrapHelper;
@@ -160,6 +181,9 @@ class WasmGraphBuilder {
WasmTrapHelper* trap_;
wasm::FunctionSig* function_signature_;
+ compiler::SourcePositionTable* source_position_table_ = nullptr;
+ compiler::SourcePositionScope* source_position_scope_ = nullptr;
+
// Internal helper methods.
JSGraph* jsgraph() { return jsgraph_; }
Graph* graph();

Powered by Google App Engine
This is Rietveld 408576698