OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/ast-numbering.h" | 9 #include "src/ast-numbering.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 OFStream os(tracing_scope.file()); | 315 OFStream os(tracing_scope.file()); |
316 os << "INLINE (" << shared->DebugName()->ToCString().get() << ") id{" | 316 os << "INLINE (" << shared->DebugName()->ToCString().get() << ") id{" |
317 << optimization_id() << "," << inline_id << "} AS " << inline_id | 317 << optimization_id() << "," << inline_id << "} AS " << inline_id |
318 << " AT " << position << std::endl; | 318 << " AT " << position << std::endl; |
319 } | 319 } |
320 | 320 |
321 return inline_id; | 321 return inline_id; |
322 } | 322 } |
323 | 323 |
324 | 324 |
| 325 void CompilationInfo::LogDeoptCallPosition(int pc_offset, int inlining_id) { |
| 326 if (!track_positions_ || IsStub()) return; |
| 327 DCHECK_LT(static_cast<size_t>(inlining_id), inlined_function_infos_->size()); |
| 328 inlined_function_infos_->at(inlining_id) |
| 329 .deopt_pc_offsets.push_back(pc_offset); |
| 330 } |
| 331 |
| 332 |
325 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { | 333 class HOptimizedGraphBuilderWithPositions: public HOptimizedGraphBuilder { |
326 public: | 334 public: |
327 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) | 335 explicit HOptimizedGraphBuilderWithPositions(CompilationInfo* info) |
328 : HOptimizedGraphBuilder(info) { | 336 : HOptimizedGraphBuilder(info) { |
329 } | 337 } |
330 | 338 |
331 #define DEF_VISIT(type) \ | 339 #define DEF_VISIT(type) \ |
332 void Visit##type(type* node) OVERRIDE { \ | 340 void Visit##type(type* node) OVERRIDE { \ |
333 SourcePosition old_position = SourcePosition::Unknown(); \ | 341 SourcePosition old_position = SourcePosition::Unknown(); \ |
334 if (node->position() != RelocInfo::kNoPosition) { \ | 342 if (node->position() != RelocInfo::kNoPosition) { \ |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1597 parse_info_ = nullptr; | 1605 parse_info_ = nullptr; |
1598 } | 1606 } |
1599 | 1607 |
1600 #if DEBUG | 1608 #if DEBUG |
1601 void CompilationInfo::PrintAstForTesting() { | 1609 void CompilationInfo::PrintAstForTesting() { |
1602 PrintF("--- Source from AST ---\n%s\n", | 1610 PrintF("--- Source from AST ---\n%s\n", |
1603 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1611 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
1604 } | 1612 } |
1605 #endif | 1613 #endif |
1606 } } // namespace v8::internal | 1614 } } // namespace v8::internal |
OLD | NEW |