diff options
| author | Ben Murdoch <benm@google.com> | 2012-04-12 10:51:47 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2012-04-16 16:41:38 +0100 |
| commit | 3ef787dbeca8a5fb1086949cda830dccee07bfbd (patch) | |
| tree | 0a22edd97aa148abffdd405c585b22213fccbc82 /src/lithium.cc | |
| parent | 85b71799222b55eb5dd74ea26efe0c64ab655c8c (diff) | |
| download | android_external_v8-3ef787dbeca8a5fb1086949cda830dccee07bfbd.tar.gz android_external_v8-3ef787dbeca8a5fb1086949cda830dccee07bfbd.tar.bz2 android_external_v8-3ef787dbeca8a5fb1086949cda830dccee07bfbd.zip | |
Merge V8 at 3.9.24.13
Bug: 5688872
Change-Id: Id0aa8d23375030494d3189c31774059c0f5398fc
Diffstat (limited to 'src/lithium.cc')
| -rw-r--r-- | src/lithium.cc | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/src/lithium.cc b/src/lithium.cc index 5410f6f0..aefd8b64 100644 --- a/src/lithium.cc +++ b/src/lithium.cc @@ -36,6 +36,7 @@ void LOperand::PrintTo(StringStream* stream) { LUnallocated* unalloc = NULL; switch (kind()) { case INVALID: + stream->Add("(0)"); break; case UNALLOCATED: unalloc = LUnallocated::cast(this); @@ -70,9 +71,6 @@ void LOperand::PrintTo(StringStream* stream) { case LUnallocated::ANY: stream->Add("(-)"); break; - case LUnallocated::IGNORE: - stream->Add("(0)"); - break; } break; case CONSTANT_OPERAND: @@ -96,13 +94,32 @@ void LOperand::PrintTo(StringStream* stream) { } } - -int LOperand::VirtualRegister() { - LUnallocated* unalloc = LUnallocated::cast(this); - return unalloc->virtual_register(); +#define DEFINE_OPERAND_CACHE(name, type) \ + name* name::cache = NULL; \ + void name::SetUpCache() { \ + if (cache) return; \ + cache = new name[kNumCachedOperands]; \ + for (int i = 0; i < kNumCachedOperands; i++) { \ + cache[i].ConvertTo(type, i); \ + } \ + } \ + +DEFINE_OPERAND_CACHE(LConstantOperand, CONSTANT_OPERAND) +DEFINE_OPERAND_CACHE(LStackSlot, STACK_SLOT) +DEFINE_OPERAND_CACHE(LDoubleStackSlot, DOUBLE_STACK_SLOT) +DEFINE_OPERAND_CACHE(LRegister, REGISTER) +DEFINE_OPERAND_CACHE(LDoubleRegister, DOUBLE_REGISTER) + +#undef DEFINE_OPERAND_CACHE + +void LOperand::SetUpCaches() { + LConstantOperand::SetUpCache(); + LStackSlot::SetUpCache(); + LDoubleStackSlot::SetUpCache(); + LRegister::SetUpCache(); + LDoubleRegister::SetUpCache(); } - bool LParallelMove::IsRedundant() const { for (int i = 0; i < move_operands_.length(); ++i) { if (!move_operands_[i].IsRedundant()) return false; @@ -156,6 +173,27 @@ void LPointerMap::RecordPointer(LOperand* op) { } +void LPointerMap::RemovePointer(LOperand* op) { + // Do not record arguments as pointers. + if (op->IsStackSlot() && op->index() < 0) return; + ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); + for (int i = 0; i < pointer_operands_.length(); ++i) { + if (pointer_operands_[i]->Equals(op)) { + pointer_operands_.Remove(i); + --i; + } + } +} + + +void LPointerMap::RecordUntagged(LOperand* op) { + // Do not record arguments as pointers. + if (op->IsStackSlot() && op->index() < 0) return; + ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot()); + untagged_operands_.Add(op); +} + + void LPointerMap::PrintTo(StringStream* stream) { stream->Add("{"); for (int i = 0; i < pointer_operands_.length(); ++i) { @@ -182,6 +220,7 @@ int ElementsKindToShiftSize(ElementsKind elements_kind) { case EXTERNAL_DOUBLE_ELEMENTS: case FAST_DOUBLE_ELEMENTS: return 3; + case FAST_SMI_ONLY_ELEMENTS: case FAST_ELEMENTS: case DICTIONARY_ELEMENTS: case NON_STRICT_ARGUMENTS_ELEMENTS: |
