OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/ast-loop-assignment-analyzer.h" | 8 #include "src/compiler/ast-loop-assignment-analyzer.h" |
9 #include "src/compiler/control-builders.h" | 9 #include "src/compiler/control-builders.h" |
10 #include "src/compiler/js-type-feedback.h" | 10 #include "src/compiler/js-type-feedback.h" |
(...skipping 3114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3125 } | 3125 } |
3126 | 3126 |
3127 return local_context; | 3127 return local_context; |
3128 } | 3128 } |
3129 | 3129 |
3130 | 3130 |
3131 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { | 3131 Node* AstGraphBuilder::BuildLocalScriptContext(Scope* scope) { |
3132 DCHECK(scope->is_script_scope()); | 3132 DCHECK(scope->is_script_scope()); |
3133 | 3133 |
3134 // Allocate a new local context. | 3134 // Allocate a new local context. |
3135 const Operator* op = javascript()->CreateScriptContext(); | 3135 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); |
3136 Node* scope_info = jsgraph()->Constant(scope->GetScopeInfo(isolate())); | 3136 const Operator* op = javascript()->CreateScriptContext(scope_info); |
3137 Node* local_context = NewNode(op, GetFunctionClosure(), scope_info); | 3137 Node* local_context = NewNode(op, GetFunctionClosure()); |
3138 PrepareFrameState(local_context, BailoutId::Prologue()); | 3138 PrepareFrameState(local_context, BailoutId::Prologue()); |
3139 | 3139 |
3140 return local_context; | 3140 return local_context; |
3141 } | 3141 } |
3142 | 3142 |
3143 | 3143 |
3144 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { | 3144 Node* AstGraphBuilder::BuildLocalBlockContext(Scope* scope) { |
3145 DCHECK(scope->is_block_scope()); | 3145 DCHECK(scope->is_block_scope()); |
3146 | 3146 |
3147 // Allocate a new local context. | 3147 // Allocate a new local context. |
3148 const Operator* op = javascript()->CreateBlockContext(); | 3148 Handle<ScopeInfo> scope_info = scope->GetScopeInfo(isolate()); |
3149 Node* scope_info = jsgraph()->Constant(scope->GetScopeInfo(isolate())); | 3149 const Operator* op = javascript()->CreateBlockContext(scope_info); |
3150 Node* local_context = NewNode(op, scope_info, GetFunctionClosureForContext()); | 3150 Node* local_context = NewNode(op, GetFunctionClosureForContext()); |
3151 | 3151 |
3152 return local_context; | 3152 return local_context; |
3153 } | 3153 } |
3154 | 3154 |
3155 | 3155 |
3156 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { | 3156 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { |
3157 if (arguments == NULL) return NULL; | 3157 if (arguments == NULL) return NULL; |
3158 | 3158 |
3159 // Allocate and initialize a new arguments object. | 3159 // Allocate and initialize a new arguments object. |
3160 CreateArgumentsParameters::Type type = | 3160 CreateArgumentsParameters::Type type = |
(...skipping 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4262 // Phi does not exist yet, introduce one. | 4262 // Phi does not exist yet, introduce one. |
4263 value = NewPhi(inputs, value, control); | 4263 value = NewPhi(inputs, value, control); |
4264 value->ReplaceInput(inputs - 1, other); | 4264 value->ReplaceInput(inputs - 1, other); |
4265 } | 4265 } |
4266 return value; | 4266 return value; |
4267 } | 4267 } |
4268 | 4268 |
4269 } // namespace compiler | 4269 } // namespace compiler |
4270 } // namespace internal | 4270 } // namespace internal |
4271 } // namespace v8 | 4271 } // namespace v8 |
OLD | NEW |