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

Side by Side Diff: src/compiler.cc

Issue 1304053004: Deprecate semi-correct CompilationInfo::flags predicate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test-pipeline.cc Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/compiler.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 209
210 bool CompilationInfo::is_this_defined() const { return !IsStub(); } 210 bool CompilationInfo::is_this_defined() const { return !IsStub(); }
211 211
212 212
213 int CompilationInfo::num_heap_slots() const { 213 int CompilationInfo::num_heap_slots() const {
214 return has_scope() ? scope()->num_heap_slots() : 0; 214 return has_scope() ? scope()->num_heap_slots() : 0;
215 } 215 }
216 216
217 217
218 Code::Flags CompilationInfo::flags() const {
219 return code_stub() != nullptr
220 ? Code::ComputeFlags(
221 code_stub()->GetCodeKind(), code_stub()->GetICState(),
222 code_stub()->GetExtraICState(), code_stub()->GetStubType())
223 : Code::ComputeFlags(Code::OPTIMIZED_FUNCTION);
224 }
225
226
227 // Primitive functions are unlikely to be picked up by the stack-walking 218 // Primitive functions are unlikely to be picked up by the stack-walking
228 // profiler, so they trigger their own optimization when they're called 219 // profiler, so they trigger their own optimization when they're called
229 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. 220 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
230 bool CompilationInfo::ShouldSelfOptimize() { 221 bool CompilationInfo::ShouldSelfOptimize() {
231 return FLAG_crankshaft && 222 return FLAG_crankshaft &&
232 !(literal()->flags() & AstProperties::kDontSelfOptimize) && 223 !(literal()->flags() & AstProperties::kDontSelfOptimize) &&
233 !literal()->dont_optimize() && 224 !literal()->dont_optimize() &&
234 literal()->scope()->AllowsLazyCompilation() && 225 literal()->scope()->AllowsLazyCompilation() &&
235 (!has_shared_info() || !shared_info()->optimization_disabled()); 226 (!has_shared_info() || !shared_info()->optimization_disabled());
236 } 227 }
(...skipping 1490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1727 1718
1728 1719
1729 #if DEBUG 1720 #if DEBUG
1730 void CompilationInfo::PrintAstForTesting() { 1721 void CompilationInfo::PrintAstForTesting() {
1731 PrintF("--- Source from AST ---\n%s\n", 1722 PrintF("--- Source from AST ---\n%s\n",
1732 PrettyPrinter(isolate(), zone()).PrintProgram(literal())); 1723 PrettyPrinter(isolate(), zone()).PrintProgram(literal()));
1733 } 1724 }
1734 #endif 1725 #endif
1735 } // namespace internal 1726 } // namespace internal
1736 } // namespace v8 1727 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/compiler/code-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698