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

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

Issue 12335102: Compile and simulate first dart function on arm generated from ast. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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"
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 359 }
360 360
361 void Remove(Location loc) { 361 void Remove(Location loc) {
362 if (loc.IsRegister()) { 362 if (loc.IsRegister()) {
363 cpu_registers_ &= ~(1 << loc.reg()); 363 cpu_registers_ &= ~(1 << loc.reg());
364 } else if (loc.IsFpuRegister()) { 364 } else if (loc.IsFpuRegister()) {
365 fpu_registers_ &= ~(1 << loc.fpu_reg()); 365 fpu_registers_ &= ~(1 << loc.fpu_reg());
366 } 366 }
367 } 367 }
368 368
369 bool ContainsRegister(Register reg) { 369 bool ContainsRegister(Register reg) const {
370 return (cpu_registers_ & (1 << reg)) != 0; 370 return (cpu_registers_ & (1 << reg)) != 0;
371 } 371 }
372 372
373 bool ContainsFpuRegister(FpuRegister fpu_reg) { 373 bool ContainsFpuRegister(FpuRegister fpu_reg) const {
374 return (fpu_registers_ & (1 << fpu_reg)) != 0; 374 return (fpu_registers_ & (1 << fpu_reg)) != 0;
375 } 375 }
376 376
377 intptr_t fpu_regs_count() { 377 intptr_t fpu_regs_count() const {
378 intptr_t count = 0; 378 intptr_t count = 0;
379 for (intptr_t reg_idx = 0; reg_idx < kNumberOfFpuRegisters; reg_idx++) { 379 for (intptr_t reg_idx = 0; reg_idx < kNumberOfFpuRegisters; reg_idx++) {
380 if (ContainsFpuRegister(static_cast<FpuRegister>(reg_idx))) { 380 if (ContainsFpuRegister(static_cast<FpuRegister>(reg_idx))) {
381 count++; 381 count++;
382 } 382 }
383 } 383 }
384 return count; 384 return count;
385 } 385 }
386 386
387 intptr_t cpu_registers() const { return cpu_registers_; }
388 intptr_t fpu_registers() const { return fpu_registers_; }
389
387 private: 390 private:
388 intptr_t cpu_registers_; 391 intptr_t cpu_registers_;
389 intptr_t fpu_registers_; 392 intptr_t fpu_registers_;
390 393
391 DISALLOW_COPY_AND_ASSIGN(RegisterSet); 394 DISALLOW_COPY_AND_ASSIGN(RegisterSet);
392 }; 395 };
393 396
394 397
395 // Specification of locations for inputs and output. 398 // Specification of locations for inputs and output.
396 class LocationSummary : public ZoneAllocated { 399 class LocationSummary : public ZoneAllocated {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 BitmapBuilder* stack_bitmap_; 488 BitmapBuilder* stack_bitmap_;
486 489
487 const ContainsCall contains_call_; 490 const ContainsCall contains_call_;
488 RegisterSet live_registers_; 491 RegisterSet live_registers_;
489 }; 492 };
490 493
491 494
492 } // namespace dart 495 } // namespace dart
493 496
494 #endif // VM_LOCATIONS_H_ 497 #endif // VM_LOCATIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698