| 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/pipeline.h" | 6 #include "src/compiler/pipeline.h" |
| 7 #include "src/compiler/raw-machine-assembler.h" | 7 #include "src/compiler/raw-machine-assembler.h" |
| 8 #include "src/compiler/scheduler.h" | 8 #include "src/compiler/scheduler.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 BasicBlock* default_block = Use(default_label); | 94 BasicBlock* default_block = Use(default_label); |
| 95 Node* default_node = graph()->NewNode(common()->IfDefault(), switch_node); | 95 Node* default_node = graph()->NewNode(common()->IfDefault(), switch_node); |
| 96 schedule()->AddNode(default_block, default_node); | 96 schedule()->AddNode(default_block, default_node); |
| 97 succ_blocks[case_count] = default_block; | 97 succ_blocks[case_count] = default_block; |
| 98 schedule()->AddSwitch(CurrentBlock(), switch_node, succ_blocks, succ_count); | 98 schedule()->AddSwitch(CurrentBlock(), switch_node, succ_blocks, succ_count); |
| 99 current_block_ = nullptr; | 99 current_block_ = nullptr; |
| 100 } | 100 } |
| 101 | 101 |
| 102 | 102 |
| 103 void RawMachineAssembler::Return(Node* value) { | 103 void RawMachineAssembler::Return(Node* value) { |
| 104 schedule()->AddReturn(CurrentBlock(), value); | 104 Node* ret = NewNode(common()->Return(), value); |
| 105 schedule()->AddReturn(CurrentBlock(), ret); |
| 105 current_block_ = NULL; | 106 current_block_ = NULL; |
| 106 } | 107 } |
| 107 | 108 |
| 108 | 109 |
| 109 Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, | 110 Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, |
| 110 Node* context, Node* frame_state, | 111 Node* context, Node* frame_state, |
| 111 CallFunctionFlags flags) { | 112 CallFunctionFlags flags) { |
| 112 Callable callable = CodeFactory::CallFunction(isolate(), 0, flags); | 113 Callable callable = CodeFactory::CallFunction(isolate(), 0, flags); |
| 113 CallDescriptor* desc = Linkage::GetStubCallDescriptor( | 114 CallDescriptor* desc = Linkage::GetStubCallDescriptor( |
| 114 isolate(), zone(), callable.descriptor(), 1, | 115 isolate(), zone(), callable.descriptor(), 1, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 } | 177 } |
| 177 | 178 |
| 178 | 179 |
| 179 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, | 180 Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count, |
| 180 Node** inputs, bool incomplete) { | 181 Node** inputs, bool incomplete) { |
| 181 DCHECK(ScheduleValid()); | 182 DCHECK(ScheduleValid()); |
| 182 DCHECK(current_block_ != NULL); | 183 DCHECK(current_block_ != NULL); |
| 183 Node* node = graph()->NewNode(op, input_count, inputs, incomplete); | 184 Node* node = graph()->NewNode(op, input_count, inputs, incomplete); |
| 184 BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start() | 185 BasicBlock* block = op->opcode() == IrOpcode::kParameter ? schedule()->start() |
| 185 : CurrentBlock(); | 186 : CurrentBlock(); |
| 186 schedule()->AddNode(block, node); | 187 if (op->opcode() != IrOpcode::kReturn) { |
| 188 schedule()->AddNode(block, node); |
| 189 } |
| 187 return node; | 190 return node; |
| 188 } | 191 } |
| 189 | 192 |
| 190 } // namespace compiler | 193 } // namespace compiler |
| 191 } // namespace internal | 194 } // namespace internal |
| 192 } // namespace v8 | 195 } // namespace v8 |
| OLD | NEW |