| 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/compiler.h" | 5 #include "src/compiler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 private: | 95 private: |
| 96 Zone zone_; | 96 Zone zone_; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 | 99 |
| 100 bool CompilationInfo::has_shared_info() const { | 100 bool CompilationInfo::has_shared_info() const { |
| 101 return parse_info_ && !parse_info_->shared_info().is_null(); | 101 return parse_info_ && !parse_info_->shared_info().is_null(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 | 104 |
| 105 bool CompilationInfo::has_context() const { |
| 106 return parse_info_ && !parse_info_->context().is_null(); |
| 107 } |
| 108 |
| 109 |
| 105 CompilationInfo::CompilationInfo(ParseInfo* parse_info) | 110 CompilationInfo::CompilationInfo(ParseInfo* parse_info) |
| 106 : CompilationInfo(parse_info, nullptr, BASE, parse_info->isolate(), | 111 : CompilationInfo(parse_info, nullptr, BASE, parse_info->isolate(), |
| 107 parse_info->zone()) { | 112 parse_info->zone()) { |
| 108 // Compiling for the snapshot typically results in different code than | 113 // Compiling for the snapshot typically results in different code than |
| 109 // compiling later on. This means that code recompiled with deoptimization | 114 // compiling later on. This means that code recompiled with deoptimization |
| 110 // support won't be "equivalent" (as defined by SharedFunctionInfo:: | 115 // support won't be "equivalent" (as defined by SharedFunctionInfo:: |
| 111 // EnableDeoptimizationSupport), so it will replace the old code and all | 116 // EnableDeoptimizationSupport), so it will replace the old code and all |
| 112 // its type feedback. To avoid this, always compile functions in the snapshot | 117 // its type feedback. To avoid this, always compile functions in the snapshot |
| 113 // with deoptimization support. | 118 // with deoptimization support. |
| 114 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); | 119 if (isolate_->serializer_enabled()) EnableDeoptimizationSupport(); |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 | 1689 |
| 1685 | 1690 |
| 1686 #if DEBUG | 1691 #if DEBUG |
| 1687 void CompilationInfo::PrintAstForTesting() { | 1692 void CompilationInfo::PrintAstForTesting() { |
| 1688 PrintF("--- Source from AST ---\n%s\n", | 1693 PrintF("--- Source from AST ---\n%s\n", |
| 1689 PrettyPrinter(isolate(), zone()).PrintProgram(function())); | 1694 PrettyPrinter(isolate(), zone()).PrintProgram(function())); |
| 1690 } | 1695 } |
| 1691 #endif | 1696 #endif |
| 1692 } // namespace internal | 1697 } // namespace internal |
| 1693 } // namespace v8 | 1698 } // namespace v8 |
| OLD | NEW |