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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |