| 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/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
| 6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
| 7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 if (hint == IfExceptionHint::kLocallyCaught) { | 1385 if (hint == IfExceptionHint::kLocallyCaught) { |
| 1386 flags |= CallDescriptor::kHasLocalCatchHandler; | 1386 flags |= CallDescriptor::kHasLocalCatchHandler; |
| 1387 } | 1387 } |
| 1388 flags |= CallDescriptor::kHasExceptionHandler; | 1388 flags |= CallDescriptor::kHasExceptionHandler; |
| 1389 buffer.instruction_args.push_back(g.Label(handler)); | 1389 buffer.instruction_args.push_back(g.Label(handler)); |
| 1390 } | 1390 } |
| 1391 | 1391 |
| 1392 // Select the appropriate opcode based on the call type. | 1392 // Select the appropriate opcode based on the call type. |
| 1393 InstructionCode opcode; | 1393 InstructionCode opcode; |
| 1394 switch (descriptor->kind()) { | 1394 switch (descriptor->kind()) { |
| 1395 case CallDescriptor::kCallCodeObject: { | 1395 case CallDescriptor::kCallAddress: |
| 1396 opcode = kArchCallCodeObject; | 1396 opcode = |
| 1397 kArchCallCFunction | |
| 1398 MiscField::encode(static_cast<int>(descriptor->CParameterCount())); |
| 1397 break; | 1399 break; |
| 1398 } | 1400 case CallDescriptor::kCallCodeObject: |
| 1401 opcode = kArchCallCodeObject | MiscField::encode(flags); |
| 1402 break; |
| 1399 case CallDescriptor::kCallJSFunction: | 1403 case CallDescriptor::kCallJSFunction: |
| 1400 opcode = kArchCallJSFunction; | 1404 opcode = kArchCallJSFunction | MiscField::encode(flags); |
| 1401 break; | 1405 break; |
| 1402 default: | 1406 default: |
| 1403 UNREACHABLE(); | 1407 UNREACHABLE(); |
| 1404 return; | 1408 return; |
| 1405 } | 1409 } |
| 1406 opcode |= MiscField::encode(flags); | |
| 1407 | 1410 |
| 1408 // Emit the call instruction. | 1411 // Emit the call instruction. |
| 1409 size_t const output_count = buffer.outputs.size(); | 1412 size_t const output_count = buffer.outputs.size(); |
| 1410 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; | 1413 auto* outputs = output_count ? &buffer.outputs.front() : nullptr; |
| 1411 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), | 1414 Emit(opcode, output_count, outputs, buffer.instruction_args.size(), |
| 1412 &buffer.instruction_args.front())->MarkAsCall(); | 1415 &buffer.instruction_args.front())->MarkAsCall(); |
| 1413 } | 1416 } |
| 1414 | 1417 |
| 1415 | 1418 |
| 1416 void InstructionSelector::VisitTailCall(Node* node) { | 1419 void InstructionSelector::VisitTailCall(Node* node) { |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2005 MachineOperatorBuilder::kFloat64RoundTruncate | | 2008 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 2006 MachineOperatorBuilder::kFloat64RoundTiesAway | | 2009 MachineOperatorBuilder::kFloat64RoundTiesAway | |
| 2007 MachineOperatorBuilder::kWord32ShiftIsSafe | | 2010 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 2008 MachineOperatorBuilder::kInt32DivIsSafe | | 2011 MachineOperatorBuilder::kInt32DivIsSafe | |
| 2009 MachineOperatorBuilder::kUint32DivIsSafe; | 2012 MachineOperatorBuilder::kUint32DivIsSafe; |
| 2010 } | 2013 } |
| 2011 | 2014 |
| 2012 } // namespace compiler | 2015 } // namespace compiler |
| 2013 } // namespace internal | 2016 } // namespace internal |
| 2014 } // namespace v8 | 2017 } // namespace v8 |
| OLD | NEW |