summaryrefslogtreecommitdiffstats
path: root/src/lithium.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2012-04-11 18:30:58 +0100
committerBen Murdoch <benm@google.com>2012-04-11 18:39:07 +0100
commit85b71799222b55eb5dd74ea26efe0c64ab655c8c (patch)
tree0d0fa6be365df4b76fe2985458b3a9b9afd80988 /src/lithium.h
parent5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b (diff)
downloadandroid_external_v8-85b71799222b55eb5dd74ea26efe0c64ab655c8c.tar.gz
android_external_v8-85b71799222b55eb5dd74ea26efe0c64ab655c8c.tar.bz2
android_external_v8-85b71799222b55eb5dd74ea26efe0c64ab655c8c.zip
Roll V8 back to 3.6
Roll back to V8 3.6 to fix x86 build, we don't have ucontext.h. This reverts commits: 5d4cdbf7a67d3662fa0bee4efdb7edd8daec9b0b c7cc028aaeedbbfa11c11d0b7b243b3d9e837ed9 592a9fc1d8ea420377a2e7efd0600e20b058be2b Bug: 5688872 Change-Id: Ic961bb5e65b778e98bbfb71cce71d99fa949e995
Diffstat (limited to 'src/lithium.h')
-rw-r--r--src/lithium.h82
1 files changed, 34 insertions, 48 deletions
diff --git a/src/lithium.h b/src/lithium.h
index d1e2e3cd..a933f72a 100644
--- a/src/lithium.h
+++ b/src/lithium.h
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -59,8 +59,8 @@ class LOperand: public ZoneObject {
bool IsDoubleRegister() const { return kind() == DOUBLE_REGISTER; }
bool IsArgument() const { return kind() == ARGUMENT; }
bool IsUnallocated() const { return kind() == UNALLOCATED; }
- bool IsIgnored() const { return kind() == INVALID; }
bool Equals(LOperand* other) const { return value_ == other->value_; }
+ int VirtualRegister();
void PrintTo(StringStream* stream);
void ConvertTo(Kind kind, int index) {
@@ -69,10 +69,6 @@ class LOperand: public ZoneObject {
ASSERT(this->index() == index);
}
- // Calls SetUpCache() for each subclass. Don't forget to update this method
- // if you add a new LOperand subclass.
- static void SetUpCaches();
-
protected:
static const int kKindFieldWidth = 3;
class KindField : public BitField<Kind, 0, kKindFieldWidth> { };
@@ -93,7 +89,8 @@ class LUnallocated: public LOperand {
FIXED_SLOT,
MUST_HAVE_REGISTER,
WRITABLE_REGISTER,
- SAME_AS_FIRST_INPUT
+ SAME_AS_FIRST_INPUT,
+ IGNORE
};
// Lifetime of operand inside the instruction.
@@ -124,9 +121,9 @@ class LUnallocated: public LOperand {
// The superclass has a KindField. Some policies have a signed fixed
// index in the upper bits.
- static const int kPolicyWidth = 3;
+ static const int kPolicyWidth = 4;
static const int kLifetimeWidth = 1;
- static const int kVirtualRegisterWidth = 18;
+ static const int kVirtualRegisterWidth = 17;
static const int kPolicyShift = kKindFieldWidth;
static const int kLifetimeShift = kPolicyShift + kPolicyWidth;
@@ -146,10 +143,12 @@ class LUnallocated: public LOperand {
kVirtualRegisterWidth> {
};
- static const int kMaxVirtualRegisters = 1 << kVirtualRegisterWidth;
+ static const int kMaxVirtualRegisters = 1 << (kVirtualRegisterWidth + 1);
static const int kMaxFixedIndex = 63;
static const int kMinFixedIndex = -64;
+ bool HasIgnorePolicy() const { return policy() == IGNORE; }
+ bool HasNoPolicy() const { return policy() == NONE; }
bool HasAnyPolicy() const {
return policy() == ANY;
}
@@ -172,7 +171,7 @@ class LUnallocated: public LOperand {
return static_cast<int>(value_) >> kFixedIndexShift;
}
- int virtual_register() const {
+ unsigned virtual_register() const {
return VirtualRegisterField::decode(value_);
}
@@ -235,7 +234,9 @@ class LMoveOperands BASE_EMBEDDED {
}
bool IsIgnored() const {
- return destination_ != NULL && destination_->IsIgnored();
+ return destination_ != NULL &&
+ destination_->IsUnallocated() &&
+ LUnallocated::cast(destination_)->HasIgnorePolicy();
}
// We clear both operands to indicate move that's been eliminated.
@@ -264,11 +265,11 @@ class LConstantOperand: public LOperand {
return reinterpret_cast<LConstantOperand*>(op);
}
- static void SetUpCache();
+ static void SetupCache();
private:
static const int kNumCachedOperands = 128;
- static LConstantOperand* cache;
+ static LConstantOperand cache[];
LConstantOperand() : LOperand() { }
explicit LConstantOperand(int index) : LOperand(CONSTANT_OPERAND, index) { }
@@ -299,11 +300,11 @@ class LStackSlot: public LOperand {
return reinterpret_cast<LStackSlot*>(op);
}
- static void SetUpCache();
+ static void SetupCache();
private:
static const int kNumCachedOperands = 128;
- static LStackSlot* cache;
+ static LStackSlot cache[];
LStackSlot() : LOperand() { }
explicit LStackSlot(int index) : LOperand(STACK_SLOT, index) { }
@@ -323,11 +324,11 @@ class LDoubleStackSlot: public LOperand {
return reinterpret_cast<LDoubleStackSlot*>(op);
}
- static void SetUpCache();
+ static void SetupCache();
private:
static const int kNumCachedOperands = 128;
- static LDoubleStackSlot* cache;
+ static LDoubleStackSlot cache[];
LDoubleStackSlot() : LOperand() { }
explicit LDoubleStackSlot(int index) : LOperand(DOUBLE_STACK_SLOT, index) { }
@@ -347,11 +348,11 @@ class LRegister: public LOperand {
return reinterpret_cast<LRegister*>(op);
}
- static void SetUpCache();
+ static void SetupCache();
private:
static const int kNumCachedOperands = 16;
- static LRegister* cache;
+ static LRegister cache[];
LRegister() : LOperand() { }
explicit LRegister(int index) : LOperand(REGISTER, index) { }
@@ -371,11 +372,11 @@ class LDoubleRegister: public LOperand {
return reinterpret_cast<LDoubleRegister*>(op);
}
- static void SetUpCache();
+ static void SetupCache();
private:
static const int kNumCachedOperands = 16;
- static LDoubleRegister* cache;
+ static LDoubleRegister cache[];
LDoubleRegister() : LOperand() { }
explicit LDoubleRegister(int index) : LOperand(DOUBLE_REGISTER, index) { }
@@ -406,18 +407,9 @@ class LParallelMove : public ZoneObject {
class LPointerMap: public ZoneObject {
public:
explicit LPointerMap(int position)
- : pointer_operands_(8),
- untagged_operands_(0),
- position_(position),
- lithium_position_(-1) { }
-
- const ZoneList<LOperand*>* GetNormalizedOperands() {
- for (int i = 0; i < untagged_operands_.length(); ++i) {
- RemovePointer(untagged_operands_[i]);
- }
- untagged_operands_.Clear();
- return &pointer_operands_;
- }
+ : pointer_operands_(8), position_(position), lithium_position_(-1) { }
+
+ const ZoneList<LOperand*>* operands() const { return &pointer_operands_; }
int position() const { return position_; }
int lithium_position() const { return lithium_position_; }
@@ -427,13 +419,10 @@ class LPointerMap: public ZoneObject {
}
void RecordPointer(LOperand* op);
- void RemovePointer(LOperand* op);
- void RecordUntagged(LOperand* op);
void PrintTo(StringStream* stream);
private:
ZoneList<LOperand*> pointer_operands_;
- ZoneList<LOperand*> untagged_operands_;
int position_;
int lithium_position_;
};
@@ -442,14 +431,12 @@ class LPointerMap: public ZoneObject {
class LEnvironment: public ZoneObject {
public:
LEnvironment(Handle<JSFunction> closure,
- FrameType frame_type,
int ast_id,
int parameter_count,
int argument_count,
int value_count,
LEnvironment* outer)
: closure_(closure),
- frame_type_(frame_type),
arguments_stack_height_(argument_count),
deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
translation_index_(-1),
@@ -457,13 +444,13 @@ class LEnvironment: public ZoneObject {
parameter_count_(parameter_count),
pc_offset_(-1),
values_(value_count),
- is_tagged_(value_count, closure->GetHeap()->isolate()->zone()),
+ representations_(value_count),
spilled_registers_(NULL),
spilled_double_registers_(NULL),
- outer_(outer) { }
+ outer_(outer) {
+ }
Handle<JSFunction> closure() const { return closure_; }
- FrameType frame_type() const { return frame_type_; }
int arguments_stack_height() const { return arguments_stack_height_; }
int deoptimization_index() const { return deoptimization_index_; }
int translation_index() const { return translation_index_; }
@@ -479,13 +466,11 @@ class LEnvironment: public ZoneObject {
void AddValue(LOperand* operand, Representation representation) {
values_.Add(operand);
- if (representation.IsTagged()) {
- is_tagged_.Add(values_.length() - 1);
- }
+ representations_.Add(representation);
}
bool HasTaggedValueAt(int index) const {
- return is_tagged_.Contains(index);
+ return representations_[index].IsTagged();
}
void Register(int deoptimization_index,
@@ -510,7 +495,6 @@ class LEnvironment: public ZoneObject {
private:
Handle<JSFunction> closure_;
- FrameType frame_type_;
int arguments_stack_height_;
int deoptimization_index_;
int translation_index_;
@@ -518,7 +502,7 @@ class LEnvironment: public ZoneObject {
int parameter_count_;
int pc_offset_;
ZoneList<LOperand*> values_;
- BitVector is_tagged_;
+ ZoneList<Representation> representations_;
// Allocation index indexed arrays of spill slot operands for registers
// that are also in spill slots at an OSR entry. NULL for environments
@@ -527,6 +511,8 @@ class LEnvironment: public ZoneObject {
LOperand** spilled_double_registers_;
LEnvironment* outer_;
+
+ friend class LCodegen;
};