| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/lithium.h" | 7 #include "src/lithium.h" |
| 8 #include "src/scopes.h" | 8 #include "src/scopes.h" |
| 9 #include "src/serialize.h" | 9 #include "src/serialize.h" |
| 10 | 10 |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 } else { | 504 } else { |
| 505 spill_slot_count_++; | 505 spill_slot_count_++; |
| 506 } | 506 } |
| 507 } | 507 } |
| 508 iterator.Advance(); | 508 iterator.Advance(); |
| 509 } | 509 } |
| 510 } | 510 } |
| 511 | 511 |
| 512 | 512 |
| 513 LEnvironment* LChunkBuilderBase::CreateEnvironment( | 513 LEnvironment* LChunkBuilderBase::CreateEnvironment( |
| 514 HEnvironment* hydrogen_env, | 514 HEnvironment* hydrogen_env, int* argument_index_accumulator, |
| 515 int* argument_index_accumulator, | |
| 516 ZoneList<HValue*>* objects_to_materialize) { | 515 ZoneList<HValue*>* objects_to_materialize) { |
| 517 if (hydrogen_env == NULL) return NULL; | 516 if (hydrogen_env == NULL) return NULL; |
| 518 | 517 |
| 519 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer(), | 518 LEnvironment* outer = |
| 520 argument_index_accumulator, | 519 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator, |
| 521 objects_to_materialize); | 520 objects_to_materialize); |
| 522 BailoutId ast_id = hydrogen_env->ast_id(); | 521 BailoutId ast_id = hydrogen_env->ast_id(); |
| 523 DCHECK(!ast_id.IsNone() || | 522 DCHECK(!ast_id.IsNone() || |
| 524 hydrogen_env->frame_type() != JS_FUNCTION); | 523 hydrogen_env->frame_type() != JS_FUNCTION); |
| 525 int value_count = hydrogen_env->length() - hydrogen_env->specials_count(); | 524 |
| 525 int omitted_count = (hydrogen_env->frame_type() == JS_FUNCTION) |
| 526 ? 0 |
| 527 : hydrogen_env->specials_count(); |
| 528 |
| 529 int value_count = hydrogen_env->length() - omitted_count; |
| 526 LEnvironment* result = | 530 LEnvironment* result = |
| 527 new(zone()) LEnvironment(hydrogen_env->closure(), | 531 new(zone()) LEnvironment(hydrogen_env->closure(), |
| 528 hydrogen_env->frame_type(), | 532 hydrogen_env->frame_type(), |
| 529 ast_id, | 533 ast_id, |
| 530 hydrogen_env->parameter_count(), | 534 hydrogen_env->parameter_count(), |
| 531 argument_count_, | 535 argument_count_, |
| 532 value_count, | 536 value_count, |
| 533 outer, | 537 outer, |
| 534 hydrogen_env->entry(), | 538 hydrogen_env->entry(), |
| 535 zone()); | 539 zone()); |
| 536 int argument_index = *argument_index_accumulator; | 540 int argument_index = *argument_index_accumulator; |
| 537 | 541 |
| 538 // Store the environment description into the environment | 542 // Store the environment description into the environment |
| 539 // (with holes for nested objects) | 543 // (with holes for nested objects) |
| 540 for (int i = 0; i < hydrogen_env->length(); ++i) { | 544 for (int i = 0; i < hydrogen_env->length(); ++i) { |
| 541 if (hydrogen_env->is_special_index(i)) continue; | 545 if (hydrogen_env->is_special_index(i) && |
| 542 | 546 hydrogen_env->frame_type() != JS_FUNCTION) { |
| 547 continue; |
| 548 } |
| 543 LOperand* op; | 549 LOperand* op; |
| 544 HValue* value = hydrogen_env->values()->at(i); | 550 HValue* value = hydrogen_env->values()->at(i); |
| 545 CHECK(!value->IsPushArguments()); // Do not deopt outgoing arguments | 551 CHECK(!value->IsPushArguments()); // Do not deopt outgoing arguments |
| 546 if (value->IsArgumentsObject() || value->IsCapturedObject()) { | 552 if (value->IsArgumentsObject() || value->IsCapturedObject()) { |
| 547 op = LEnvironment::materialization_marker(); | 553 op = LEnvironment::materialization_marker(); |
| 548 } else { | 554 } else { |
| 549 op = UseAny(value); | 555 op = UseAny(value); |
| 550 } | 556 } |
| 551 result->AddValue(op, | 557 result->AddValue(op, |
| 552 value->representation(), | 558 value->representation(), |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 | 649 |
| 644 | 650 |
| 645 LPhase::~LPhase() { | 651 LPhase::~LPhase() { |
| 646 if (ShouldProduceTraceOutput()) { | 652 if (ShouldProduceTraceOutput()) { |
| 647 isolate()->GetHTracer()->TraceLithium(name(), chunk_); | 653 isolate()->GetHTracer()->TraceLithium(name(), chunk_); |
| 648 } | 654 } |
| 649 } | 655 } |
| 650 | 656 |
| 651 | 657 |
| 652 } } // namespace v8::internal | 658 } } // namespace v8::internal |
| OLD | NEW |