OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 4555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4566 function = new(zone()) HLoadContextSlot( | 4566 function = new(zone()) HLoadContextSlot( |
4567 outer_context, Context::CLOSURE_INDEX, HLoadContextSlot::kNoCheck); | 4567 outer_context, Context::CLOSURE_INDEX, HLoadContextSlot::kNoCheck); |
4568 } else { | 4568 } else { |
4569 function = New<HThisFunction>(); | 4569 function = New<HThisFunction>(); |
4570 } | 4570 } |
4571 AddInstruction(function); | 4571 AddInstruction(function); |
4572 // Allocate a block context and store it to the stack frame. | 4572 // Allocate a block context and store it to the stack frame. |
4573 HInstruction* inner_context = Add<HAllocateBlockContext>( | 4573 HInstruction* inner_context = Add<HAllocateBlockContext>( |
4574 outer_context, function, scope->GetScopeInfo()); | 4574 outer_context, function, scope->GetScopeInfo()); |
4575 HInstruction* instr = Add<HStoreFrameContext>(inner_context); | 4575 HInstruction* instr = Add<HStoreFrameContext>(inner_context); |
| 4576 set_scope(scope); |
| 4577 environment()->BindContext(inner_context); |
4576 if (instr->HasObservableSideEffects()) { | 4578 if (instr->HasObservableSideEffects()) { |
4577 AddSimulate(stmt->EntryId(), REMOVABLE_SIMULATE); | 4579 AddSimulate(stmt->EntryId(), REMOVABLE_SIMULATE); |
4578 } | 4580 } |
4579 set_scope(scope); | |
4580 environment()->BindContext(inner_context); | |
4581 VisitDeclarations(scope->declarations()); | 4581 VisitDeclarations(scope->declarations()); |
4582 AddSimulate(stmt->DeclsId(), REMOVABLE_SIMULATE); | 4582 AddSimulate(stmt->DeclsId(), REMOVABLE_SIMULATE); |
4583 } | 4583 } |
4584 CHECK_BAILOUT(VisitStatements(stmt->statements())); | 4584 CHECK_BAILOUT(VisitStatements(stmt->statements())); |
4585 } | 4585 } |
4586 set_scope(outer_scope); | 4586 set_scope(outer_scope); |
4587 if (scope != NULL && current_block() != NULL) { | 4587 if (scope != NULL && current_block() != NULL) { |
4588 HValue* inner_context = environment()->context(); | 4588 HValue* inner_context = environment()->context(); |
4589 HValue* outer_context = Add<HLoadNamedField>( | 4589 HValue* outer_context = Add<HLoadNamedField>( |
4590 inner_context, static_cast<HValue*>(NULL), | 4590 inner_context, static_cast<HValue*>(NULL), |
4591 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); | 4591 HObjectAccess::ForContextSlot(Context::PREVIOUS_INDEX)); |
4592 | 4592 |
4593 HInstruction* instr = Add<HStoreFrameContext>(outer_context); | 4593 HInstruction* instr = Add<HStoreFrameContext>(outer_context); |
| 4594 environment()->BindContext(outer_context); |
4594 if (instr->HasObservableSideEffects()) { | 4595 if (instr->HasObservableSideEffects()) { |
4595 AddSimulate(stmt->ExitId(), REMOVABLE_SIMULATE); | 4596 AddSimulate(stmt->ExitId(), REMOVABLE_SIMULATE); |
4596 } | 4597 } |
4597 environment()->BindContext(outer_context); | |
4598 } | 4598 } |
4599 HBasicBlock* break_block = break_info.break_block(); | 4599 HBasicBlock* break_block = break_info.break_block(); |
4600 if (break_block != NULL) { | 4600 if (break_block != NULL) { |
4601 if (current_block() != NULL) Goto(break_block); | 4601 if (current_block() != NULL) Goto(break_block); |
4602 break_block->SetJoinId(stmt->ExitId()); | 4602 break_block->SetJoinId(stmt->ExitId()); |
4603 set_current_block(break_block); | 4603 set_current_block(break_block); |
4604 } | 4604 } |
4605 } | 4605 } |
4606 | 4606 |
4607 | 4607 |
(...skipping 8412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13020 if (ShouldProduceTraceOutput()) { | 13020 if (ShouldProduceTraceOutput()) { |
13021 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13021 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13022 } | 13022 } |
13023 | 13023 |
13024 #ifdef DEBUG | 13024 #ifdef DEBUG |
13025 graph_->Verify(false); // No full verify. | 13025 graph_->Verify(false); // No full verify. |
13026 #endif | 13026 #endif |
13027 } | 13027 } |
13028 | 13028 |
13029 } } // namespace v8::internal | 13029 } } // namespace v8::internal |
OLD | NEW |