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/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 bool CompilationInfo::has_shared_info() const { | 108 bool CompilationInfo::has_shared_info() const { |
109 return parse_info_ && !parse_info_->shared_info().is_null(); | 109 return parse_info_ && !parse_info_->shared_info().is_null(); |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 bool CompilationInfo::has_context() const { | 113 bool CompilationInfo::has_context() const { |
114 return parse_info_ && !parse_info_->context().is_null(); | 114 return parse_info_ && !parse_info_->context().is_null(); |
115 } | 115 } |
116 | 116 |
117 | 117 |
118 bool CompilationInfo::has_literal() const { | |
119 return parse_info_ && parse_info_->literal() != nullptr; | |
120 } | |
121 | |
122 | |
123 bool CompilationInfo::has_scope() const { | 118 bool CompilationInfo::has_scope() const { |
124 return parse_info_ && parse_info_->scope() != nullptr; | 119 return parse_info_ && parse_info_->scope() != nullptr; |
125 } | 120 } |
126 | 121 |
127 | 122 |
128 CompilationInfo::CompilationInfo(ParseInfo* parse_info) | 123 CompilationInfo::CompilationInfo(ParseInfo* parse_info) |
129 : CompilationInfo(parse_info, nullptr, Code::ComputeFlags(Code::FUNCTION), | 124 : CompilationInfo(parse_info, nullptr, Code::ComputeFlags(Code::FUNCTION), |
130 BASE, parse_info->isolate(), parse_info->zone()) { | 125 BASE, parse_info->isolate(), parse_info->zone()) { |
131 // Compiling for the snapshot typically results in different code than | 126 // Compiling for the snapshot typically results in different code than |
132 // compiling later on. This means that code recompiled with deoptimization | 127 // compiling later on. This means that code recompiled with deoptimization |
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1935 MaybeHandle<Code> code; | 1930 MaybeHandle<Code> code; |
1936 if (cached.code != nullptr) code = handle(cached.code); | 1931 if (cached.code != nullptr) code = handle(cached.code); |
1937 Handle<Context> native_context(function->context()->native_context()); | 1932 Handle<Context> native_context(function->context()->native_context()); |
1938 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1933 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
1939 literals, BailoutId::None()); | 1934 literals, BailoutId::None()); |
1940 } | 1935 } |
1941 } | 1936 } |
1942 | 1937 |
1943 } // namespace internal | 1938 } // namespace internal |
1944 } // namespace v8 | 1939 } // namespace v8 |
OLD | NEW |