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

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

Issue 501323002: Replace our homegrown ARRAY_SIZE() with Chrome's arraysize(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months 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 | Annotate | Revision Log
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-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 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 inputs[input_count++] = g.Label(cont->false_block()); 117 inputs[input_count++] = g.Label(cont->false_block());
118 } 118 }
119 119
120 outputs[output_count++] = g.DefineAsRegister(node); 120 outputs[output_count++] = g.DefineAsRegister(node);
121 if (cont->IsSet()) { 121 if (cont->IsSet()) {
122 outputs[output_count++] = g.DefineAsRegister(cont->result()); 122 outputs[output_count++] = g.DefineAsRegister(cont->result());
123 } 123 }
124 124
125 DCHECK_NE(0, input_count); 125 DCHECK_NE(0, input_count);
126 DCHECK_NE(0, output_count); 126 DCHECK_NE(0, output_count);
127 DCHECK_GE(ARRAY_SIZE(inputs), input_count); 127 DCHECK_GE(arraysize(inputs), input_count);
128 DCHECK_GE(ARRAY_SIZE(outputs), output_count); 128 DCHECK_GE(arraysize(outputs), output_count);
129 129
130 Instruction* instr = selector->Emit(cont->Encode(opcode), output_count, 130 Instruction* instr = selector->Emit(cont->Encode(opcode), output_count,
131 outputs, input_count, inputs); 131 outputs, input_count, inputs);
132 if (cont->IsBranch()) instr->MarkAsControl(); 132 if (cont->IsBranch()) instr->MarkAsControl();
133 } 133 }
134 134
135 135
136 // Shared routine for multiple binary operations. 136 // Shared routine for multiple binary operations.
137 static void VisitBinop(InstructionSelector* selector, Node* node, 137 static void VisitBinop(InstructionSelector* selector, Node* node,
138 ArchOpcode opcode, ImmediateMode operand_mode) { 138 ArchOpcode opcode, ImmediateMode operand_mode) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 191
192 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node); 192 StoreRepresentation store_rep = OpParameter<StoreRepresentation>(node);
193 MachineType rep = RepresentationOf(store_rep.machine_type); 193 MachineType rep = RepresentationOf(store_rep.machine_type);
194 if (store_rep.write_barrier_kind == kFullWriteBarrier) { 194 if (store_rep.write_barrier_kind == kFullWriteBarrier) {
195 DCHECK(rep == kRepTagged); 195 DCHECK(rep == kRepTagged);
196 // TODO(dcarney): refactor RecordWrite function to take temp registers 196 // TODO(dcarney): refactor RecordWrite function to take temp registers
197 // and pass them here instead of using fixed regs 197 // and pass them here instead of using fixed regs
198 // TODO(dcarney): handle immediate indices. 198 // TODO(dcarney): handle immediate indices.
199 InstructionOperand* temps[] = {g.TempRegister(x11), g.TempRegister(x12)}; 199 InstructionOperand* temps[] = {g.TempRegister(x11), g.TempRegister(x12)};
200 Emit(kArm64StoreWriteBarrier, NULL, g.UseFixed(base, x10), 200 Emit(kArm64StoreWriteBarrier, NULL, g.UseFixed(base, x10),
201 g.UseFixed(index, x11), g.UseFixed(value, x12), ARRAY_SIZE(temps), 201 g.UseFixed(index, x11), g.UseFixed(value, x12), arraysize(temps),
202 temps); 202 temps);
203 return; 203 return;
204 } 204 }
205 DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind); 205 DCHECK_EQ(kNoWriteBarrier, store_rep.write_barrier_kind);
206 ArchOpcode opcode; 206 ArchOpcode opcode;
207 switch (rep) { 207 switch (rep) {
208 case kRepFloat32: 208 case kRepFloat32:
209 opcode = kArm64StrS; 209 opcode = kArm64StrS;
210 break; 210 break;
211 case kRepFloat64: 211 case kRepFloat64:
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // Caller clean up of stack for C-style calls. 667 // Caller clean up of stack for C-style calls.
668 if (is_c_frame && aligned_push_count > 0) { 668 if (is_c_frame && aligned_push_count > 0) {
669 DCHECK(deoptimization == NULL && continuation == NULL); 669 DCHECK(deoptimization == NULL && continuation == NULL);
670 Emit(kArm64Drop | MiscField::encode(aligned_push_count), NULL); 670 Emit(kArm64Drop | MiscField::encode(aligned_push_count), NULL);
671 } 671 }
672 } 672 }
673 673
674 } // namespace compiler 674 } // namespace compiler
675 } // namespace internal 675 } // namespace internal
676 } // namespace v8 676 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698