OLD | NEW |
---|---|
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/js-create-lowering.h" | 5 #include "src/compiler/js-create-lowering.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
286 // arguments object, but only for non-inlined (i.e. outermost) frames. | 286 // arguments object, but only for non-inlined (i.e. outermost) frames. |
287 if (outer_state->opcode() != IrOpcode::kFrameState) { | 287 if (outer_state->opcode() != IrOpcode::kFrameState) { |
288 switch (type) { | 288 switch (type) { |
289 case CreateArgumentsType::kMappedArguments: { | 289 case CreateArgumentsType::kMappedArguments: { |
290 // TODO(mstarzinger): Duplicate parameters are not handled yet. | 290 // TODO(mstarzinger): Duplicate parameters are not handled yet. |
291 Handle<SharedFunctionInfo> shared_info; | 291 Handle<SharedFunctionInfo> shared_info; |
292 if (!state_info.shared_info().ToHandle(&shared_info) || | 292 if (!state_info.shared_info().ToHandle(&shared_info) || |
293 shared_info->has_duplicate_parameters()) { | 293 shared_info->has_duplicate_parameters()) { |
294 return NoChange(); | 294 return NoChange(); |
295 } | 295 } |
296 // TODO(bmeurer): Actually we don't need a frame state here. | |
297 Callable callable = CodeFactory::FastNewSloppyArguments(isolate()); | 296 Callable callable = CodeFactory::FastNewSloppyArguments(isolate()); |
298 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 297 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
299 isolate(), graph()->zone(), callable.descriptor(), 0, | 298 isolate(), graph()->zone(), callable.descriptor(), 0, |
300 CallDescriptor::kNeedsFrameState); | 299 CallDescriptor::kNoFlags); |
301 const Operator* new_op = common()->Call(desc); | 300 const Operator* new_op = common()->Call(desc); |
302 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 301 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
303 node->InsertInput(graph()->zone(), 0, stub_code); | 302 node->InsertInput(graph()->zone(), 0, stub_code); |
303 node->RemoveInput(3); | |
Jarin
2016/05/11 04:45:27
Could you say in the comment that you are removing
Benedikt Meurer
2016/05/11 05:37:48
Done.
| |
304 NodeProperties::ChangeOp(node, new_op); | 304 NodeProperties::ChangeOp(node, new_op); |
305 return Changed(node); | 305 return Changed(node); |
306 } | 306 } |
307 case CreateArgumentsType::kUnmappedArguments: { | 307 case CreateArgumentsType::kUnmappedArguments: { |
308 // TODO(bmeurer): Actually we don't need a frame state here. | |
309 Callable callable = CodeFactory::FastNewStrictArguments(isolate()); | 308 Callable callable = CodeFactory::FastNewStrictArguments(isolate()); |
310 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 309 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
311 isolate(), graph()->zone(), callable.descriptor(), 0, | 310 isolate(), graph()->zone(), callable.descriptor(), 0, |
312 CallDescriptor::kNeedsFrameState); | 311 CallDescriptor::kNoFlags); |
313 const Operator* new_op = common()->Call(desc); | 312 const Operator* new_op = common()->Call(desc); |
314 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 313 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
315 node->InsertInput(graph()->zone(), 0, stub_code); | 314 node->InsertInput(graph()->zone(), 0, stub_code); |
315 node->RemoveInput(3); | |
316 NodeProperties::ChangeOp(node, new_op); | 316 NodeProperties::ChangeOp(node, new_op); |
317 return Changed(node); | 317 return Changed(node); |
318 } | 318 } |
319 case CreateArgumentsType::kRestParameter: { | 319 case CreateArgumentsType::kRestParameter: { |
320 // TODO(bmeurer): Actually we don't need a frame state here. | |
321 Callable callable = CodeFactory::FastNewRestParameter(isolate()); | 320 Callable callable = CodeFactory::FastNewRestParameter(isolate()); |
322 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 321 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
323 isolate(), graph()->zone(), callable.descriptor(), 0, | 322 isolate(), graph()->zone(), callable.descriptor(), 0, |
324 CallDescriptor::kNeedsFrameState); | 323 CallDescriptor::kNoFlags); |
325 const Operator* new_op = common()->Call(desc); | 324 const Operator* new_op = common()->Call(desc); |
326 Node* stub_code = jsgraph()->HeapConstant(callable.code()); | 325 Node* stub_code = jsgraph()->HeapConstant(callable.code()); |
327 node->InsertInput(graph()->zone(), 0, stub_code); | 326 node->InsertInput(graph()->zone(), 0, stub_code); |
327 node->RemoveInput(3); | |
328 NodeProperties::ChangeOp(node, new_op); | 328 NodeProperties::ChangeOp(node, new_op); |
329 return Changed(node); | 329 return Changed(node); |
330 } | 330 } |
331 } | 331 } |
332 UNREACHABLE(); | 332 UNREACHABLE(); |
333 } else if (outer_state->opcode() == IrOpcode::kFrameState) { | 333 } else if (outer_state->opcode() == IrOpcode::kFrameState) { |
334 // Use inline allocation for all mapped arguments objects within inlined | 334 // Use inline allocation for all mapped arguments objects within inlined |
335 // (i.e. non-outermost) frames, independent of the object size. | 335 // (i.e. non-outermost) frames, independent of the object size. |
336 if (type == CreateArgumentsType::kMappedArguments) { | 336 if (type == CreateArgumentsType::kMappedArguments) { |
337 Handle<SharedFunctionInfo> shared; | 337 Handle<SharedFunctionInfo> shared; |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1130 return jsgraph()->simplified(); | 1130 return jsgraph()->simplified(); |
1131 } | 1131 } |
1132 | 1132 |
1133 MachineOperatorBuilder* JSCreateLowering::machine() const { | 1133 MachineOperatorBuilder* JSCreateLowering::machine() const { |
1134 return jsgraph()->machine(); | 1134 return jsgraph()->machine(); |
1135 } | 1135 } |
1136 | 1136 |
1137 } // namespace compiler | 1137 } // namespace compiler |
1138 } // namespace internal | 1138 } // namespace internal |
1139 } // namespace v8 | 1139 } // namespace v8 |
OLD | NEW |