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 3134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3145 | 3145 |
3146 return local_context; | 3146 return local_context; |
3147 } | 3147 } |
3148 | 3148 |
3149 | 3149 |
3150 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { | 3150 Node* AstGraphBuilder::BuildArgumentsObject(Variable* arguments) { |
3151 if (arguments == NULL) return NULL; | 3151 if (arguments == NULL) return NULL; |
3152 | 3152 |
3153 // Allocate and initialize a new arguments object. | 3153 // Allocate and initialize a new arguments object. |
3154 Node* callee = GetFunctionClosure(); | 3154 Node* callee = GetFunctionClosure(); |
3155 const Operator* op = javascript()->CallRuntime(Runtime::kNewArguments, 1); | 3155 CreateArgumentsParameters::Type type = |
| 3156 is_strict(language_mode()) || !info()->has_simple_parameters() |
| 3157 ? CreateArgumentsParameters::UNMAPPED_ARGUMENTS |
| 3158 : CreateArgumentsParameters::MAPPED_ARGUMENTS; |
| 3159 const Operator* op = javascript()->CreateArguments(type, 0); |
3156 Node* object = NewNode(op, callee); | 3160 Node* object = NewNode(op, callee); |
3157 | 3161 |
3158 // Assign the object to the arguments variable. | 3162 // Assign the object to the arguments variable. |
3159 DCHECK(arguments->IsContextSlot() || arguments->IsStackAllocated()); | 3163 DCHECK(arguments->IsContextSlot() || arguments->IsStackAllocated()); |
3160 // This should never lazy deopt, so it is fine to send invalid bailout id. | 3164 // This should never lazy deopt, so it is fine to send invalid bailout id. |
3161 FrameStateBeforeAndAfter states(this, BailoutId::None()); | 3165 FrameStateBeforeAndAfter states(this, BailoutId::None()); |
3162 BuildVariableAssignment(arguments, object, Token::ASSIGN, VectorSlotPair(), | 3166 BuildVariableAssignment(arguments, object, Token::ASSIGN, VectorSlotPair(), |
3163 BailoutId::None(), states); | 3167 BailoutId::None(), states); |
3164 return object; | 3168 return object; |
3165 } | 3169 } |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4250 // Phi does not exist yet, introduce one. | 4254 // Phi does not exist yet, introduce one. |
4251 value = NewPhi(inputs, value, control); | 4255 value = NewPhi(inputs, value, control); |
4252 value->ReplaceInput(inputs - 1, other); | 4256 value->ReplaceInput(inputs - 1, other); |
4253 } | 4257 } |
4254 return value; | 4258 return value; |
4255 } | 4259 } |
4256 | 4260 |
4257 } // namespace compiler | 4261 } // namespace compiler |
4258 } // namespace internal | 4262 } // namespace internal |
4259 } // namespace v8 | 4263 } // namespace v8 |
OLD | NEW |