| 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/code-factory.h" | 5 #include "src/code-factory.h" |
| 6 #include "src/compiler/access-builder.h" | 6 #include "src/compiler/access-builder.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-typed-lowering.h" | 8 #include "src/compiler/js-typed-lowering.h" |
| 9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
| 10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 // Check that {function} is actually a JSFunction with the correct arity. | 1394 // Check that {function} is actually a JSFunction with the correct arity. |
| 1395 if (function_type->IsFunction() && | 1395 if (function_type->IsFunction() && |
| 1396 function_type->AsFunction()->Arity() == arity) { | 1396 function_type->AsFunction()->Arity() == arity) { |
| 1397 // Check that the {receiver} doesn't need to be wrapped. | 1397 // Check that the {receiver} doesn't need to be wrapped. |
| 1398 if (receiver_type->Is(Type::ReceiverOrUndefined())) { | 1398 if (receiver_type->Is(Type::ReceiverOrUndefined())) { |
| 1399 Node* const context = graph()->NewNode( | 1399 Node* const context = graph()->NewNode( |
| 1400 simplified()->LoadField(AccessBuilder::ForJSFunctionContext()), | 1400 simplified()->LoadField(AccessBuilder::ForJSFunctionContext()), |
| 1401 function, effect, control); | 1401 function, effect, control); |
| 1402 NodeProperties::ReplaceContextInput(node, context); | 1402 NodeProperties::ReplaceContextInput(node, context); |
| 1403 CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; | 1403 CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; |
| 1404 if (p.AllowTailCalls()) { | 1404 if (is_strict(p.language_mode())) { |
| 1405 flags |= CallDescriptor::kSupportsTailCalls; | 1405 flags |= CallDescriptor::kSupportsTailCalls; |
| 1406 } | 1406 } |
| 1407 NodeProperties::ChangeOp(node, | 1407 NodeProperties::ChangeOp(node, |
| 1408 common()->Call(Linkage::GetJSCallDescriptor( | 1408 common()->Call(Linkage::GetJSCallDescriptor( |
| 1409 graph()->zone(), false, 1 + arity, flags))); | 1409 graph()->zone(), false, 1 + arity, flags))); |
| 1410 return Changed(node); | 1410 return Changed(node); |
| 1411 } | 1411 } |
| 1412 } | 1412 } |
| 1413 return NoChange(); | 1413 return NoChange(); |
| 1414 } | 1414 } |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 } | 1830 } |
| 1831 | 1831 |
| 1832 | 1832 |
| 1833 MachineOperatorBuilder* JSTypedLowering::machine() const { | 1833 MachineOperatorBuilder* JSTypedLowering::machine() const { |
| 1834 return jsgraph()->machine(); | 1834 return jsgraph()->machine(); |
| 1835 } | 1835 } |
| 1836 | 1836 |
| 1837 } // namespace compiler | 1837 } // namespace compiler |
| 1838 } // namespace internal | 1838 } // namespace internal |
| 1839 } // namespace v8 | 1839 } // namespace v8 |
| OLD | NEW |