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

Side by Side Diff: src/crankshaft/lithium.cc

Issue 1782743003: [crankshaft] Support inlining of function calls in tail position (in ES6 sense). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@tco-crank-4
Patch Set: ppc, s390 and x87 ports Created 4 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/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/lithium-codegen.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/crankshaft/lithium.h" 5 #include "src/crankshaft/lithium.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 8
9 #if V8_TARGET_ARCH_IA32 9 #if V8_TARGET_ARCH_IA32
10 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT 10 #include "src/crankshaft/ia32/lithium-ia32.h" // NOLINT
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 instr->set_environment(CreateEnvironment( 515 instr->set_environment(CreateEnvironment(
516 hydrogen_env, &argument_index_accumulator, &objects_to_materialize)); 516 hydrogen_env, &argument_index_accumulator, &objects_to_materialize));
517 return instr; 517 return instr;
518 } 518 }
519 519
520 LEnvironment* LChunkBuilderBase::CreateEnvironment( 520 LEnvironment* LChunkBuilderBase::CreateEnvironment(
521 HEnvironment* hydrogen_env, int* argument_index_accumulator, 521 HEnvironment* hydrogen_env, int* argument_index_accumulator,
522 ZoneList<HValue*>* objects_to_materialize) { 522 ZoneList<HValue*>* objects_to_materialize) {
523 if (hydrogen_env == NULL) return NULL; 523 if (hydrogen_env == NULL) return NULL;
524 524
525 BailoutId ast_id = hydrogen_env->ast_id();
526 DCHECK(!ast_id.IsNone() ||
527 (hydrogen_env->frame_type() != JS_FUNCTION &&
528 hydrogen_env->frame_type() != TAIL_CALLER_FUNCTION));
529
530 if (hydrogen_env->frame_type() == TAIL_CALLER_FUNCTION) {
531 // Skip potential outer arguments adaptor frame.
532 HEnvironment* outer_hydrogen_env = hydrogen_env->outer();
533 if (outer_hydrogen_env != nullptr &&
534 outer_hydrogen_env->frame_type() == ARGUMENTS_ADAPTOR) {
535 outer_hydrogen_env = outer_hydrogen_env->outer();
536 }
537 LEnvironment* outer = CreateEnvironment(
538 outer_hydrogen_env, argument_index_accumulator, objects_to_materialize);
539 return new (zone())
540 LEnvironment(hydrogen_env->closure(), hydrogen_env->frame_type(),
541 ast_id, 0, 0, 0, outer, hydrogen_env->entry(), zone());
542 }
543
525 LEnvironment* outer = 544 LEnvironment* outer =
526 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator, 545 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator,
527 objects_to_materialize); 546 objects_to_materialize);
528 BailoutId ast_id = hydrogen_env->ast_id();
529 DCHECK(!ast_id.IsNone() ||
530 hydrogen_env->frame_type() != JS_FUNCTION);
531 547
532 int omitted_count = (hydrogen_env->frame_type() == JS_FUNCTION) 548 int omitted_count = (hydrogen_env->frame_type() == JS_FUNCTION)
533 ? 0 549 ? 0
534 : hydrogen_env->specials_count(); 550 : hydrogen_env->specials_count();
535 551
536 int value_count = hydrogen_env->length() - omitted_count; 552 int value_count = hydrogen_env->length() - omitted_count;
537 LEnvironment* result = 553 LEnvironment* result =
538 new(zone()) LEnvironment(hydrogen_env->closure(), 554 new(zone()) LEnvironment(hydrogen_env->closure(),
539 hydrogen_env->frame_type(), 555 hydrogen_env->frame_type(),
540 ast_id, 556 ast_id,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 673
658 LPhase::~LPhase() { 674 LPhase::~LPhase() {
659 if (ShouldProduceTraceOutput()) { 675 if (ShouldProduceTraceOutput()) {
660 isolate()->GetHTracer()->TraceLithium(name(), chunk_); 676 isolate()->GetHTracer()->TraceLithium(name(), chunk_);
661 } 677 }
662 } 678 }
663 679
664 680
665 } // namespace internal 681 } // namespace internal
666 } // namespace v8 682 } // namespace v8
OLDNEW
« no previous file with comments | « src/crankshaft/ia32/lithium-ia32.cc ('k') | src/crankshaft/lithium-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698