Reviewers: Benedikt Meurer,
Description:
Translate AST to Hydrogen missing position
This patch translates RelocInfo::kNoPosition to SourcePosition::Unknown()
in constructing the Hydrogen graph from the parser's output. The translation
is done to increase the flexibility of the parser to desugar more things
that don't have natural locations.
R=bmeu...@chromium.org
BUG=v8:4377
LOG=N
Please review this at https://codereview.chromium.org/1313443002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+3, -0 lines):
M src/hydrogen.h
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index
c6953cdad52cca2b4ccd602ff1f67ba6edf950b7..b61013d8801e34008ae9473a9c43c876297c7e6d
100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -1889,6 +1889,9 @@ class HGraphBuilder {
// the SourcePosition assuming that this position corresponds to the
// same function as current position_.
SourcePosition ScriptPositionToSourcePosition(int position) {
+ if (position == RelocInfo::kNoPosition) {
+ return SourcePosition::Unknown();
+ }
SourcePosition pos = position_;
pos.set_position(position - start_position_);
return pos;
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.