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

Side by Side Diff: src/compiler/instruction.h

Issue 1365073002: Revert of Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/instruction.cc » ('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 #ifndef V8_COMPILER_INSTRUCTION_H_ 5 #ifndef V8_COMPILER_INSTRUCTION_H_
6 #define V8_COMPILER_INSTRUCTION_H_ 6 #define V8_COMPILER_INSTRUCTION_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <iosfwd> 9 #include <iosfwd>
10 #include <map> 10 #include <map>
11 #include <set> 11 #include <set>
12 12
13 #include "src/compiler/common-operator.h" 13 #include "src/compiler/common-operator.h"
14 #include "src/compiler/frame.h" 14 #include "src/compiler/frame.h"
15 #include "src/compiler/instruction-codes.h" 15 #include "src/compiler/instruction-codes.h"
16 #include "src/compiler/opcodes.h" 16 #include "src/compiler/opcodes.h"
17 #include "src/compiler/register-configuration.h"
17 #include "src/compiler/source-position.h" 18 #include "src/compiler/source-position.h"
18 #include "src/macro-assembler.h"
19 #include "src/register-configuration.h"
20 #include "src/zone-allocator.h" 19 #include "src/zone-allocator.h"
21 20
22 namespace v8 { 21 namespace v8 {
23 namespace internal { 22 namespace internal {
24 namespace compiler { 23 namespace compiler {
25 24
26 class Schedule; 25 class Schedule;
27 26
28 class InstructionOperand { 27 class InstructionOperand {
29 public: 28 public:
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 AllocatedOperand(AllocatedKind kind, MachineType machine_type, int index) 366 AllocatedOperand(AllocatedKind kind, MachineType machine_type, int index)
368 : InstructionOperand(ALLOCATED) { 367 : InstructionOperand(ALLOCATED) {
369 DCHECK_IMPLIES(kind == REGISTER || kind == DOUBLE_REGISTER, index >= 0); 368 DCHECK_IMPLIES(kind == REGISTER || kind == DOUBLE_REGISTER, index >= 0);
370 DCHECK(IsSupportedMachineType(machine_type)); 369 DCHECK(IsSupportedMachineType(machine_type));
371 value_ |= AllocatedKindField::encode(kind); 370 value_ |= AllocatedKindField::encode(kind);
372 value_ |= MachineTypeField::encode(machine_type); 371 value_ |= MachineTypeField::encode(machine_type);
373 value_ |= static_cast<int64_t>(index) << IndexField::kShift; 372 value_ |= static_cast<int64_t>(index) << IndexField::kShift;
374 } 373 }
375 374
376 int index() const { 375 int index() const {
377 DCHECK(STACK_SLOT == allocated_kind() ||
378 DOUBLE_STACK_SLOT == allocated_kind());
379 return static_cast<int64_t>(value_) >> IndexField::kShift; 376 return static_cast<int64_t>(value_) >> IndexField::kShift;
380 } 377 }
381 378
382 Register GetRegister() const {
383 DCHECK(REGISTER == allocated_kind() || DOUBLE_REGISTER == allocated_kind());
384 return Register::from_code(static_cast<int64_t>(value_) >>
385 IndexField::kShift);
386 }
387
388 DoubleRegister GetDoubleRegister() const {
389 DCHECK(REGISTER == allocated_kind() || DOUBLE_REGISTER == allocated_kind());
390 return DoubleRegister::from_code(static_cast<int64_t>(value_) >>
391 IndexField::kShift);
392 }
393
394 AllocatedKind allocated_kind() const { 379 AllocatedKind allocated_kind() const {
395 return AllocatedKindField::decode(value_); 380 return AllocatedKindField::decode(value_);
396 } 381 }
397 382
398 MachineType machine_type() const { return MachineTypeField::decode(value_); } 383 MachineType machine_type() const { return MachineTypeField::decode(value_); }
399 384
400 static AllocatedOperand* New(Zone* zone, AllocatedKind kind, 385 static AllocatedOperand* New(Zone* zone, AllocatedKind kind,
401 MachineType machine_type, int index) { 386 MachineType machine_type, int index) {
402 return InstructionOperand::New(zone, 387 return InstructionOperand::New(zone,
403 AllocatedOperand(kind, machine_type, index)); 388 AllocatedOperand(kind, machine_type, index));
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 1213
1229 1214
1230 std::ostream& operator<<(std::ostream& os, 1215 std::ostream& operator<<(std::ostream& os,
1231 const PrintableInstructionSequence& code); 1216 const PrintableInstructionSequence& code);
1232 1217
1233 } // namespace compiler 1218 } // namespace compiler
1234 } // namespace internal 1219 } // namespace internal
1235 } // namespace v8 1220 } // namespace v8
1236 1221
1237 #endif // V8_COMPILER_INSTRUCTION_H_ 1222 #endif // V8_COMPILER_INSTRUCTION_H_
OLDNEW
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698