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

Side by Side Diff: src/compiler.cc

Issue 1010673004: Tweak the TurboFan pipeline for stub compilation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed feedback Created 5 years, 9 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/js-intrinsic-lowering.h » ('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/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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 DependentCode* dependent_code = 214 DependentCode* dependent_code =
215 DependentCode::ForObject(group_objects->at(j), group); 215 DependentCode::ForObject(group_objects->at(j), group);
216 dependent_code->RemoveCompilationInfo(group, info); 216 dependent_code->RemoveCompilationInfo(group, info);
217 } 217 }
218 dependencies_[i] = NULL; // Zone-allocated, no need to delete. 218 dependencies_[i] = NULL; // Zone-allocated, no need to delete.
219 } 219 }
220 } 220 }
221 221
222 222
223 int CompilationInfo::num_parameters() const { 223 int CompilationInfo::num_parameters() const {
224 if (IsStub()) { 224 return has_scope() ? scope()->num_parameters() : parameter_count_;
225 DCHECK(parameter_count_ > 0);
226 return parameter_count_;
227 } else {
228 return scope()->num_parameters();
229 }
230 } 225 }
231 226
232 227
233 int CompilationInfo::num_heap_slots() const { 228 int CompilationInfo::num_heap_slots() const {
234 if (IsStub()) { 229 return has_scope() ? scope()->num_heap_slots() : 0;
235 return 0;
236 } else {
237 return scope()->num_heap_slots();
238 }
239 } 230 }
240 231
241 232
242 Code::Flags CompilationInfo::flags() const { 233 Code::Flags CompilationInfo::flags() const {
243 if (IsStub()) { 234 return code_stub() != nullptr
244 return Code::ComputeFlags(code_stub()->GetCodeKind(), 235 ? Code::ComputeFlags(
245 code_stub()->GetICState(), 236 code_stub()->GetCodeKind(), code_stub()->GetICState(),
246 code_stub()->GetExtraICState(), 237 code_stub()->GetExtraICState(), code_stub()->GetStubType())
247 code_stub()->GetStubType()); 238 : Code::ComputeFlags(Code::OPTIMIZED_FUNCTION);
248 } else {
249 return Code::ComputeFlags(Code::OPTIMIZED_FUNCTION);
250 }
251 } 239 }
252 240
253 241
254 // Primitive functions are unlikely to be picked up by the stack-walking 242 // Primitive functions are unlikely to be picked up by the stack-walking
255 // profiler, so they trigger their own optimization when they're called 243 // profiler, so they trigger their own optimization when they're called
256 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time. 244 // for the SharedFunctionInfo::kCallsUntilPrimitiveOptimization-th time.
257 bool CompilationInfo::ShouldSelfOptimize() { 245 bool CompilationInfo::ShouldSelfOptimize() {
258 return FLAG_crankshaft && !function()->flags()->Contains(kDontSelfOptimize) && 246 return FLAG_crankshaft && !function()->flags()->Contains(kDontSelfOptimize) &&
259 !function()->dont_optimize() && 247 !function()->dont_optimize() &&
260 function()->scope()->AllowsLazyCompilation() && 248 function()->scope()->AllowsLazyCompilation() &&
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1605 parse_info_ = nullptr; 1593 parse_info_ = nullptr;
1606 } 1594 }
1607 1595
1608 #if DEBUG 1596 #if DEBUG
1609 void CompilationInfo::PrintAstForTesting() { 1597 void CompilationInfo::PrintAstForTesting() {
1610 PrintF("--- Source from AST ---\n%s\n", 1598 PrintF("--- Source from AST ---\n%s\n",
1611 PrettyPrinter(isolate(), zone()).PrintProgram(function())); 1599 PrettyPrinter(isolate(), zone()).PrintProgram(function()));
1612 } 1600 }
1613 #endif 1601 #endif
1614 } } // namespace v8::internal 1602 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.h ('k') | src/compiler/js-intrinsic-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698