| 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/js-typed-lowering.h" | 5 #include "src/compiler/js-typed-lowering.h" |
| 6 | 6 |
| 7 #include "src/ast/modules.h" | 7 #include "src/ast/modules.h" |
| 8 #include "src/builtins/builtins-utils.h" | 8 #include "src/builtins/builtins-utils.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/compilation-dependencies.h" | 10 #include "src/compilation-dependencies.h" |
| (...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1198 | 1198 |
| 1199 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); | 1199 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); |
| 1200 Node* etrue = effect; | 1200 Node* etrue = effect; |
| 1201 Node* rtrue = receiver; | 1201 Node* rtrue = receiver; |
| 1202 | 1202 |
| 1203 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); | 1203 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); |
| 1204 Node* efalse = effect; | 1204 Node* efalse = effect; |
| 1205 Node* rfalse; | 1205 Node* rfalse; |
| 1206 { | 1206 { |
| 1207 // Convert {receiver} using the ToObjectStub. | 1207 // Convert {receiver} using the ToObjectStub. |
| 1208 Callable callable = CodeFactory::ToObject(isolate()); | 1208 Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject); |
| 1209 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( | 1209 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( |
| 1210 isolate(), graph()->zone(), callable.descriptor(), 0, | 1210 isolate(), graph()->zone(), callable.descriptor(), 0, |
| 1211 CallDescriptor::kNeedsFrameState, node->op()->properties()); | 1211 CallDescriptor::kNeedsFrameState, node->op()->properties()); |
| 1212 rfalse = efalse = if_false = graph()->NewNode( | 1212 rfalse = efalse = if_false = graph()->NewNode( |
| 1213 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), | 1213 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), |
| 1214 receiver, context, frame_state, efalse, if_false); | 1214 receiver, context, frame_state, efalse, if_false); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 control = graph()->NewNode(common()->Merge(2), if_true, if_false); | 1217 control = graph()->NewNode(common()->Merge(2), if_true, if_false); |
| 1218 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); | 1218 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); | 1560 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); |
| 1561 Node* etrue = effect; | 1561 Node* etrue = effect; |
| 1562 Node* rtrue = receiver; | 1562 Node* rtrue = receiver; |
| 1563 | 1563 |
| 1564 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); | 1564 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); |
| 1565 Node* efalse = effect; | 1565 Node* efalse = effect; |
| 1566 Node* rfalse; | 1566 Node* rfalse; |
| 1567 { | 1567 { |
| 1568 // Convert {receiver} using the ToObjectStub. The call does not require a | 1568 // Convert {receiver} using the ToObjectStub. The call does not require a |
| 1569 // frame-state in this case, because neither null nor undefined is passed. | 1569 // frame-state in this case, because neither null nor undefined is passed. |
| 1570 Callable callable = CodeFactory::ToObject(isolate()); | 1570 Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject); |
| 1571 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( | 1571 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( |
| 1572 isolate(), graph()->zone(), callable.descriptor(), 0, | 1572 isolate(), graph()->zone(), callable.descriptor(), 0, |
| 1573 CallDescriptor::kNoFlags, node->op()->properties()); | 1573 CallDescriptor::kNoFlags, node->op()->properties()); |
| 1574 rfalse = efalse = graph()->NewNode( | 1574 rfalse = efalse = graph()->NewNode( |
| 1575 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), | 1575 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), |
| 1576 receiver, context, efalse); | 1576 receiver, context, efalse); |
| 1577 } | 1577 } |
| 1578 | 1578 |
| 1579 control = graph()->NewNode(common()->Merge(2), if_true, if_false); | 1579 control = graph()->NewNode(common()->Merge(2), if_true, if_false); |
| 1580 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); | 1580 effect = graph()->NewNode(common()->EffectPhi(2), etrue, efalse, control); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1618 Node* enoop = effect; | 1618 Node* enoop = effect; |
| 1619 Node* rnoop = receiver; | 1619 Node* rnoop = receiver; |
| 1620 | 1620 |
| 1621 // Convert {receiver} using ToObject. | 1621 // Convert {receiver} using ToObject. |
| 1622 Node* if_convert = if_false2; | 1622 Node* if_convert = if_false2; |
| 1623 Node* econvert = effect; | 1623 Node* econvert = effect; |
| 1624 Node* rconvert; | 1624 Node* rconvert; |
| 1625 { | 1625 { |
| 1626 // Convert {receiver} using the ToObjectStub. The call does not require a | 1626 // Convert {receiver} using the ToObjectStub. The call does not require a |
| 1627 // frame-state in this case, because neither null nor undefined is passed. | 1627 // frame-state in this case, because neither null nor undefined is passed. |
| 1628 Callable callable = CodeFactory::ToObject(isolate()); | 1628 Callable callable = Builtins::CallableFor(isolate(), Builtins::kToObject); |
| 1629 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( | 1629 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( |
| 1630 isolate(), graph()->zone(), callable.descriptor(), 0, | 1630 isolate(), graph()->zone(), callable.descriptor(), 0, |
| 1631 CallDescriptor::kNoFlags, node->op()->properties()); | 1631 CallDescriptor::kNoFlags, node->op()->properties()); |
| 1632 rconvert = econvert = graph()->NewNode( | 1632 rconvert = econvert = graph()->NewNode( |
| 1633 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), | 1633 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), |
| 1634 receiver, context, econvert); | 1634 receiver, context, econvert); |
| 1635 } | 1635 } |
| 1636 | 1636 |
| 1637 // Replace {receiver} with global proxy of {context}. | 1637 // Replace {receiver} with global proxy of {context}. |
| 1638 Node* if_global = graph()->NewNode(common()->Merge(2), if_true1, if_true2); | 1638 Node* if_global = graph()->NewNode(common()->Merge(2), if_true1, if_true2); |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2325 } | 2325 } |
| 2326 | 2326 |
| 2327 | 2327 |
| 2328 CompilationDependencies* JSTypedLowering::dependencies() const { | 2328 CompilationDependencies* JSTypedLowering::dependencies() const { |
| 2329 return dependencies_; | 2329 return dependencies_; |
| 2330 } | 2330 } |
| 2331 | 2331 |
| 2332 } // namespace compiler | 2332 } // namespace compiler |
| 2333 } // namespace internal | 2333 } // namespace internal |
| 2334 } // namespace v8 | 2334 } // namespace v8 |
| OLD | NEW |