Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 763963002: [turbofan] Add checked load/store operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Reapply fix. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/instruction-selector.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 size_t temp_count, InstructionOperand** temps) { 126 size_t temp_count, InstructionOperand** temps) {
127 size_t output_count = output == NULL ? 0 : 1; 127 size_t output_count = output == NULL ? 0 : 1;
128 InstructionOperand* inputs[] = {a, b, c, d}; 128 InstructionOperand* inputs[] = {a, b, c, d};
129 size_t input_count = arraysize(inputs); 129 size_t input_count = arraysize(inputs);
130 return Emit(opcode, output_count, &output, input_count, inputs, temp_count, 130 return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
131 temps); 131 temps);
132 } 132 }
133 133
134 134
135 Instruction* InstructionSelector::Emit( 135 Instruction* InstructionSelector::Emit(
136 InstructionCode opcode, InstructionOperand* output, InstructionOperand* a,
137 InstructionOperand* b, InstructionOperand* c, InstructionOperand* d,
138 InstructionOperand* e, size_t temp_count, InstructionOperand** temps) {
139 size_t output_count = output == NULL ? 0 : 1;
140 InstructionOperand* inputs[] = {a, b, c, d, e};
141 size_t input_count = arraysize(inputs);
142 return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
143 temps);
144 }
145
146
147 Instruction* InstructionSelector::Emit(
148 InstructionCode opcode, InstructionOperand* output, InstructionOperand* a,
149 InstructionOperand* b, InstructionOperand* c, InstructionOperand* d,
150 InstructionOperand* e, InstructionOperand* f, size_t temp_count,
151 InstructionOperand** temps) {
152 size_t output_count = output == NULL ? 0 : 1;
153 InstructionOperand* inputs[] = {a, b, c, d, e, f};
154 size_t input_count = arraysize(inputs);
155 return Emit(opcode, output_count, &output, input_count, inputs, temp_count,
156 temps);
157 }
158
159
160 Instruction* InstructionSelector::Emit(
136 InstructionCode opcode, size_t output_count, InstructionOperand** outputs, 161 InstructionCode opcode, size_t output_count, InstructionOperand** outputs,
137 size_t input_count, InstructionOperand** inputs, size_t temp_count, 162 size_t input_count, InstructionOperand** inputs, size_t temp_count,
138 InstructionOperand** temps) { 163 InstructionOperand** temps) {
139 Instruction* instr = 164 Instruction* instr =
140 Instruction::New(instruction_zone(), opcode, output_count, outputs, 165 Instruction::New(instruction_zone(), opcode, output_count, outputs,
141 input_count, inputs, temp_count, temps); 166 input_count, inputs, temp_count, temps);
142 return Emit(instr); 167 return Emit(instr);
143 } 168 }
144 169
145 170
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 return kMachAnyTagged; 556 return kMachAnyTagged;
532 case IrOpcode::kCall: 557 case IrOpcode::kCall:
533 return kMachAnyTagged; 558 return kMachAnyTagged;
534 case IrOpcode::kFrameState: 559 case IrOpcode::kFrameState:
535 case IrOpcode::kStateValues: 560 case IrOpcode::kStateValues:
536 return kMachNone; 561 return kMachNone;
537 case IrOpcode::kLoad: 562 case IrOpcode::kLoad:
538 return OpParameter<LoadRepresentation>(node); 563 return OpParameter<LoadRepresentation>(node);
539 case IrOpcode::kStore: 564 case IrOpcode::kStore:
540 return kMachNone; 565 return kMachNone;
566 case IrOpcode::kCheckedLoad:
567 return OpParameter<MachineType>(node);
568 case IrOpcode::kCheckedStore:
569 return kMachNone;
541 case IrOpcode::kWord32And: 570 case IrOpcode::kWord32And:
542 case IrOpcode::kWord32Or: 571 case IrOpcode::kWord32Or:
543 case IrOpcode::kWord32Xor: 572 case IrOpcode::kWord32Xor:
544 case IrOpcode::kWord32Shl: 573 case IrOpcode::kWord32Shl:
545 case IrOpcode::kWord32Shr: 574 case IrOpcode::kWord32Shr:
546 case IrOpcode::kWord32Sar: 575 case IrOpcode::kWord32Sar:
547 case IrOpcode::kWord32Ror: 576 case IrOpcode::kWord32Ror:
548 return kMachInt32; 577 return kMachInt32;
549 case IrOpcode::kWord32Equal: 578 case IrOpcode::kWord32Equal:
550 return kMachBool; 579 return kMachBool;
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 case IrOpcode::kFloat64Floor: 830 case IrOpcode::kFloat64Floor:
802 return MarkAsDouble(node), VisitFloat64Floor(node); 831 return MarkAsDouble(node), VisitFloat64Floor(node);
803 case IrOpcode::kFloat64Ceil: 832 case IrOpcode::kFloat64Ceil:
804 return MarkAsDouble(node), VisitFloat64Ceil(node); 833 return MarkAsDouble(node), VisitFloat64Ceil(node);
805 case IrOpcode::kFloat64RoundTruncate: 834 case IrOpcode::kFloat64RoundTruncate:
806 return MarkAsDouble(node), VisitFloat64RoundTruncate(node); 835 return MarkAsDouble(node), VisitFloat64RoundTruncate(node);
807 case IrOpcode::kFloat64RoundTiesAway: 836 case IrOpcode::kFloat64RoundTiesAway:
808 return MarkAsDouble(node), VisitFloat64RoundTiesAway(node); 837 return MarkAsDouble(node), VisitFloat64RoundTiesAway(node);
809 case IrOpcode::kLoadStackPointer: 838 case IrOpcode::kLoadStackPointer:
810 return VisitLoadStackPointer(node); 839 return VisitLoadStackPointer(node);
840 case IrOpcode::kCheckedLoad: {
841 MachineType rep = OpParameter<MachineType>(node);
842 MarkAsRepresentation(rep, node);
843 return VisitCheckedLoad(node);
844 }
845 case IrOpcode::kCheckedStore:
846 return VisitCheckedStore(node);
811 default: 847 default:
812 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d", 848 V8_Fatal(__FILE__, __LINE__, "Unexpected operator #%d:%s @ node #%d",
813 node->opcode(), node->op()->mnemonic(), node->id()); 849 node->opcode(), node->op()->mnemonic(), node->id());
814 break; 850 break;
815 } 851 }
816 } 852 }
817 853
818 854
819 #if V8_TURBOFAN_BACKEND 855 #if V8_TURBOFAN_BACKEND
820 856
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 MachineOperatorBuilder::Flags 1144 MachineOperatorBuilder::Flags
1109 InstructionSelector::SupportedMachineOperatorFlags() { 1145 InstructionSelector::SupportedMachineOperatorFlags() {
1110 return MachineOperatorBuilder::Flag::kNoFlags; 1146 return MachineOperatorBuilder::Flag::kNoFlags;
1111 } 1147 }
1112 1148
1113 #endif // !V8_TURBOFAN_BACKEND 1149 #endif // !V8_TURBOFAN_BACKEND
1114 1150
1115 } // namespace compiler 1151 } // namespace compiler
1116 } // namespace internal 1152 } // namespace internal
1117 } // namespace v8 1153 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.h ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698