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

Side by Side Diff: runtime/vm/locations.h

Issue 504143003: Support Int32 representation for selected binary operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_LOCATIONS_H_ 5 #ifndef VM_LOCATIONS_H_
6 #define VM_LOCATIONS_H_ 6 #define VM_LOCATIONS_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/bitfield.h" 10 #include "vm/bitfield.h"
11 11
12 namespace dart { 12 namespace dart {
13 13
14 class BufferFormatter; 14 class BufferFormatter;
15 class Value; 15 class Value;
16 class PairLocation; 16 class PairLocation;
17 class ConstantInstr;
17 18
18 19
19 enum Representation { 20 enum Representation {
20 kNoRepresentation, 21 kNoRepresentation,
21 kTagged, 22 kTagged,
22 kUntagged, 23 kUntagged,
23 kUnboxedDouble, 24 kUnboxedDouble,
25 kUnboxedInt32,
24 kUnboxedUint32, 26 kUnboxedUint32,
25 kUnboxedMint, 27 kUnboxedMint,
26 kUnboxedFloat32x4, 28 kUnboxedFloat32x4,
27 kUnboxedInt32x4, 29 kUnboxedInt32x4,
28 kUnboxedFloat64x2, 30 kUnboxedFloat64x2,
29 kPairOfTagged, 31 kPairOfTagged,
30 kPairOfUnboxedDouble, 32 kPairOfUnboxedDouble,
31 kNumRepresentations 33 kNumRepresentations
32 }; 34 };
33 35
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 138
137 bool IsInvalid() const { 139 bool IsInvalid() const {
138 return value_ == kInvalidLocation; 140 return value_ == kInvalidLocation;
139 } 141 }
140 142
141 // Constants. 143 // Constants.
142 bool IsConstant() const { 144 bool IsConstant() const {
143 return (value_ & kLocationTagMask) == kConstantTag; 145 return (value_ & kLocationTagMask) == kConstantTag;
144 } 146 }
145 147
146 static Location Constant(const Object& obj) { 148 static Location Constant(ConstantInstr* obj) {
147 Location loc(reinterpret_cast<uword>(&obj) | kConstantTag); 149 Location loc(reinterpret_cast<uword>(obj) | kConstantTag);
148 ASSERT(&obj == &loc.constant()); 150 ASSERT(obj == loc.constant_instruction());
149 return loc; 151 return loc;
150 } 152 }
151 153
152 const Object& constant() const { 154 ConstantInstr* constant_instruction() const {
153 ASSERT(IsConstant()); 155 ASSERT(IsConstant());
154 return *reinterpret_cast<const Object*>(value_ & ~kLocationTagMask); 156 return reinterpret_cast<ConstantInstr*>(value_ & ~kLocationTagMask);
155 } 157 }
156 158
159 const Object& constant() const;
160
157 bool IsPairLocation() const { 161 bool IsPairLocation() const {
158 return (value_ & kLocationTagMask) == kPairLocationTag; 162 return (value_ & kLocationTagMask) == kPairLocationTag;
159 } 163 }
160 164
161 static Location Pair(Location first, Location second); 165 static Location Pair(Location first, Location second);
162 166
163 PairLocation* AsPairLocation() const; 167 PairLocation* AsPairLocation() const;
164 168
165 // Unallocated locations. 169 // Unallocated locations.
166 enum Policy { 170 enum Policy {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 BitmapBuilder* stack_bitmap_; 641 BitmapBuilder* stack_bitmap_;
638 642
639 const ContainsCall contains_call_; 643 const ContainsCall contains_call_;
640 RegisterSet live_registers_; 644 RegisterSet live_registers_;
641 }; 645 };
642 646
643 647
644 } // namespace dart 648 } // namespace dart
645 649
646 #endif // VM_LOCATIONS_H_ 650 #endif // VM_LOCATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698