OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.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 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1592 Node* data = jsgraph()->Constant(call_data_object); | 1592 Node* data = jsgraph()->Constant(call_data_object); |
1593 ApiFunction function(v8::ToCData<Address>(call_handler_info->callback())); | 1593 ApiFunction function(v8::ToCData<Address>(call_handler_info->callback())); |
1594 Node* function_reference = | 1594 Node* function_reference = |
1595 graph()->NewNode(common()->ExternalConstant(ExternalReference( | 1595 graph()->NewNode(common()->ExternalConstant(ExternalReference( |
1596 &function, ExternalReference::DIRECT_API_CALL, isolate()))); | 1596 &function, ExternalReference::DIRECT_API_CALL, isolate()))); |
1597 Node* code = jsgraph()->HeapConstant(stub.GetCode()); | 1597 Node* code = jsgraph()->HeapConstant(stub.GetCode()); |
1598 | 1598 |
1599 // Add CallApiCallbackStub's register argument as well. | 1599 // Add CallApiCallbackStub's register argument as well. |
1600 Node* inputs[11] = { | 1600 Node* inputs[11] = { |
1601 code, target, data, receiver /* holder */, function_reference, receiver}; | 1601 code, target, data, receiver /* holder */, function_reference, receiver}; |
1602 if (value != nullptr) { | |
1603 inputs[6] = value; | |
1604 } | |
1605 int index = 6 + argc; | 1602 int index = 6 + argc; |
1606 inputs[index++] = context; | 1603 inputs[index++] = context; |
1607 inputs[index++] = frame_state; | 1604 inputs[index++] = frame_state; |
1608 inputs[index++] = effect; | 1605 inputs[index++] = effect; |
1609 inputs[index++] = control; | 1606 inputs[index++] = control; |
| 1607 // This needs to stay here because of the edge case described in |
| 1608 // http://crbug.com/675648. |
| 1609 if (value != nullptr) { |
| 1610 inputs[6] = value; |
| 1611 } |
1610 | 1612 |
1611 Node* effect0; | 1613 Node* effect0; |
1612 Node* value0 = effect0 = | 1614 Node* value0 = effect0 = |
1613 graph()->NewNode(common()->Call(call_descriptor), index, inputs); | 1615 graph()->NewNode(common()->Call(call_descriptor), index, inputs); |
1614 Node* control0 = graph()->NewNode(common()->IfSuccess(), value0); | 1616 Node* control0 = graph()->NewNode(common()->IfSuccess(), value0); |
1615 return ValueEffectControl(value0, effect0, control0); | 1617 return ValueEffectControl(value0, effect0, control0); |
1616 } | 1618 } |
1617 | 1619 |
1618 Node* JSNativeContextSpecialization::BuildCheckHeapObject(Node* receiver, | 1620 Node* JSNativeContextSpecialization::BuildCheckHeapObject(Node* receiver, |
1619 Node** effect, | 1621 Node** effect, |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 return jsgraph()->javascript(); | 1829 return jsgraph()->javascript(); |
1828 } | 1830 } |
1829 | 1831 |
1830 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1832 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
1831 return jsgraph()->simplified(); | 1833 return jsgraph()->simplified(); |
1832 } | 1834 } |
1833 | 1835 |
1834 } // namespace compiler | 1836 } // namespace compiler |
1835 } // namespace internal | 1837 } // namespace internal |
1836 } // namespace v8 | 1838 } // namespace v8 |
OLD | NEW |