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

Unified Diff: src/compiler.cc

Issue 962593005: CpuProfiler: do not calculate positions if it is not necessary (TryInline part). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: unnecessary change was removed Created 5 years, 10 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
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 4dbe5983e1f9e74f7af70c49ebdbaa05ec988722..a5d303044d8e474accfe77aafb68d4d092593d10 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -336,9 +336,7 @@ bool CompilationInfo::is_simple_parameter_list() {
int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
SourcePosition position) {
- if (!FLAG_hydrogen_track_positions) {
- return 0;
- }
+ DCHECK(FLAG_hydrogen_track_positions);
DCHECK(inlined_function_infos_);
DCHECK(inlining_id_to_function_id_);
@@ -395,22 +393,32 @@ class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder {
: HOptimizedGraphBuilder(info) {
}
-#define DEF_VISIT(type) \
- void Visit##type(type* node) OVERRIDE { \
- if (node->position() != RelocInfo::kNoPosition) { \
- SetSourcePosition(node->position()); \
- } \
- HOptimizedGraphBuilder::Visit##type(node); \
+#define DEF_VISIT(type) \
+ void Visit##type(type* node) OVERRIDE { \
+ SourcePosition old_position = SourcePosition::Unknown(); \
+ if (node->position() != RelocInfo::kNoPosition) { \
+ old_position = source_position(); \
+ SetSourcePosition(node->position()); \
+ } \
+ HOptimizedGraphBuilder::Visit##type(node); \
+ if (!old_position.IsUnknown()) { \
+ set_source_position(old_position); \
+ } \
}
EXPRESSION_NODE_LIST(DEF_VISIT)
#undef DEF_VISIT
-#define DEF_VISIT(type) \
- void Visit##type(type* node) OVERRIDE { \
- if (node->position() != RelocInfo::kNoPosition) { \
- SetSourcePosition(node->position()); \
- } \
- HOptimizedGraphBuilder::Visit##type(node); \
+#define DEF_VISIT(type) \
+ void Visit##type(type* node) OVERRIDE { \
+ SourcePosition old_position = SourcePosition::Unknown(); \
+ if (node->position() != RelocInfo::kNoPosition) { \
+ old_position = source_position(); \
+ SetSourcePosition(node->position()); \
+ } \
+ HOptimizedGraphBuilder::Visit##type(node); \
+ if (!old_position.IsUnknown()) { \
+ set_source_position(old_position); \
+ } \
}
STATEMENT_NODE_LIST(DEF_VISIT)
#undef DEF_VISIT
« no previous file with comments | « no previous file | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698