| 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
| (...skipping 4717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4728 if (declaration_scope->is_script_scope() || | 4728 if (declaration_scope->is_script_scope() || |
| 4729 declaration_scope->is_eval_scope()) { | 4729 declaration_scope->is_eval_scope()) { |
| 4730 function = new (zone()) | 4730 function = new (zone()) |
| 4731 HLoadContextSlot(outer_context, Context::CLOSURE_INDEX, | 4731 HLoadContextSlot(outer_context, Context::CLOSURE_INDEX, |
| 4732 HLoadContextSlot::kNoCheck); | 4732 HLoadContextSlot::kNoCheck); |
| 4733 } else { | 4733 } else { |
| 4734 function = New<HThisFunction>(); | 4734 function = New<HThisFunction>(); |
| 4735 } | 4735 } |
| 4736 AddInstruction(function); | 4736 AddInstruction(function); |
| 4737 // Allocate a block context and store it to the stack frame. | 4737 // Allocate a block context and store it to the stack frame. |
| 4738 HInstruction* inner_context = Add<HAllocateBlockContext>( | 4738 HValue* scope_info = Add<HConstant>(scope->GetScopeInfo(isolate())); |
| 4739 outer_context, function, scope->GetScopeInfo(isolate())); | 4739 Add<HPushArguments>(scope_info, function); |
| 4740 HInstruction* inner_context = Add<HCallRuntime>( |
| 4741 Runtime::FunctionForId(Runtime::kPushBlockContext), 2); |
| 4742 inner_context->SetFlag(HValue::kHasNoObservableSideEffects); |
| 4740 HInstruction* instr = Add<HStoreFrameContext>(inner_context); | 4743 HInstruction* instr = Add<HStoreFrameContext>(inner_context); |
| 4741 set_scope(scope); | 4744 set_scope(scope); |
| 4742 environment()->BindContext(inner_context); | 4745 environment()->BindContext(inner_context); |
| 4743 if (instr->HasObservableSideEffects()) { | 4746 if (instr->HasObservableSideEffects()) { |
| 4744 AddSimulate(stmt->EntryId(), REMOVABLE_SIMULATE); | 4747 AddSimulate(stmt->EntryId(), REMOVABLE_SIMULATE); |
| 4745 } | 4748 } |
| 4746 } | 4749 } |
| 4747 VisitDeclarations(scope->declarations()); | 4750 VisitDeclarations(scope->declarations()); |
| 4748 AddSimulate(stmt->DeclsId(), REMOVABLE_SIMULATE); | 4751 AddSimulate(stmt->DeclsId(), REMOVABLE_SIMULATE); |
| 4749 } | 4752 } |
| (...skipping 8806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13556 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13559 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13557 } | 13560 } |
| 13558 | 13561 |
| 13559 #ifdef DEBUG | 13562 #ifdef DEBUG |
| 13560 graph_->Verify(false); // No full verify. | 13563 graph_->Verify(false); // No full verify. |
| 13561 #endif | 13564 #endif |
| 13562 } | 13565 } |
| 13563 | 13566 |
| 13564 } // namespace internal | 13567 } // namespace internal |
| 13565 } // namespace v8 | 13568 } // namespace v8 |
| OLD | NEW |