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

Unified Diff: runtime/vm/locations.h

Issue 10823308: Implement basic support for deferred slow path code with calls that save and restore live registers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/locations.h
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
index 6e4393ca6a797b7fe8e340687aa270a6547c086c..535675e8b2f77c38401fd097c838fb989c147d26 100644
--- a/runtime/vm/locations.h
+++ b/runtime/vm/locations.h
@@ -208,12 +208,34 @@ class Location : public ValueObject {
};
+class RegisterSet : public ValueObject {
+ public:
+ RegisterSet() : registers_(0) {
+ ASSERT(kNumberOfCpuRegisters < (kWordSize * kBitsPerByte));
+ }
+
+ void Add(Register reg) {
+ registers_ |= (1 << reg);
+ }
+
+ bool Contains(Register reg) {
+ return (registers_ & (1 << reg)) != 0;
+ }
+
+ private:
+ intptr_t registers_;
+
+ DISALLOW_COPY_AND_ASSIGN(RegisterSet);
+};
+
+
// Specification of locations for inputs and output.
class LocationSummary : public ZoneAllocated {
public:
enum ContainsCall {
kNoCall,
kCall,
+ kCallOnSlowPath
};
LocationSummary(intptr_t input_count,
@@ -262,7 +284,6 @@ class LocationSummary : public ZoneAllocated {
return &output_location_;
}
-
void set_out(Location loc) {
ASSERT(!is_call() || loc.IsRegister());
output_location_ = loc;
@@ -271,14 +292,22 @@ class LocationSummary : public ZoneAllocated {
BitmapBuilder* stack_bitmap() const { return stack_bitmap_; }
bool is_call() const {
- return is_call_;
+ return contains_call_ == kCall;
+ }
+
+ ContainsCall contains_call() const {
Kevin Millikin (Google) 2012/08/14 11:18:16 It sounds like this returns a boolean, but it does
Vyacheslav Egorov (Google) 2012/08/14 12:31:13 Done.
+ return contains_call_;
}
void PrintTo(BufferFormatter* f) const;
static LocationSummary* Make(intptr_t input_count,
Location out,
- LocationSummary::ContainsCall contains_call);
+ ContainsCall contains_call);
+
+ RegisterSet* live_registers() {
+ return &live_registers_;
+ }
private:
// TODO(vegorov): replace with ZoneArray.
@@ -286,7 +315,9 @@ class LocationSummary : public ZoneAllocated {
GrowableArray<Location> temp_locations_;
Location output_location_;
BitmapBuilder* stack_bitmap_;
- const bool is_call_;
+
+ const ContainsCall contains_call_;
+ RegisterSet live_registers_;
};

Powered by Google App Engine
This is Rietveld 408576698