Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Redistribution and use in source and binary forms, with or without | 
| 3 // found in the LICENSE file. | 3 // modification, are permitted provided that the following conditions are | 
| 4 // met: | |
| 5 // | |
| 6 // * Redistributions of source code must retain the above copyright | |
| 
 
Michael Starzinger
2014/07/30 13:03:04
Let's switch to the short copyright header.
 
 | |
| 7 // notice, this list of conditions and the following disclaimer. | |
| 8 // * Redistributions in binary form must reproduce the above | |
| 9 // copyright notice, this list of conditions and the following | |
| 10 // disclaimer in the documentation and/or other materials provided | |
| 11 // with the distribution. | |
| 12 // * Neither the name of Google Inc. nor the names of its | |
| 13 // contributors may be used to endorse or promote products derived | |
| 14 // from this software without specific prior written permission. | |
| 15 // | |
| 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
| 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
| 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
| 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
| 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
| 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
| 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| 4 | 27 | 
| 5 #ifndef V8_LITHIUM_ALLOCATOR_INL_H_ | 28 #ifndef V8_LITHIUM_INL_H_ | 
| 6 #define V8_LITHIUM_ALLOCATOR_INL_H_ | 29 #define V8_LITHIUM_INL_H_ | 
| 7 | 30 | 
| 8 #include "src/lithium-allocator.h" | 31 #include "src/lithium.h" | 
| 9 | 32 | 
| 10 #if V8_TARGET_ARCH_IA32 | 33 #if V8_TARGET_ARCH_IA32 | 
| 11 #include "src/ia32/lithium-ia32.h" // NOLINT | 34 #include "src/ia32/lithium-ia32.h" // NOLINT | 
| 12 #elif V8_TARGET_ARCH_X64 | 35 #elif V8_TARGET_ARCH_X64 | 
| 13 #include "src/x64/lithium-x64.h" // NOLINT | 36 #include "src/x64/lithium-x64.h" // NOLINT | 
| 14 #elif V8_TARGET_ARCH_ARM64 | 37 #elif V8_TARGET_ARCH_ARM64 | 
| 15 #include "src/arm64/lithium-arm64.h" // NOLINT | 38 #include "src/arm64/lithium-arm64.h" // NOLINT | 
| 16 #elif V8_TARGET_ARCH_ARM | 39 #elif V8_TARGET_ARCH_ARM | 
| 17 #include "src/arm/lithium-arm.h" // NOLINT | 40 #include "src/arm/lithium-arm.h" // NOLINT | 
| 41 #elif V8_TARGET_ARCH_A64 | |
| 
 
Michael Starzinger
2014/07/30 13:03:04
The #ifdef for A64 should be dropped, must have sn
 
 | |
| 42 #include "src/a64/lithium-a64.h" // NOLINT | |
| 18 #elif V8_TARGET_ARCH_MIPS | 43 #elif V8_TARGET_ARCH_MIPS | 
| 19 #include "src/mips/lithium-mips.h" // NOLINT | 44 #include "src/mips/lithium-mips.h" // NOLINT | 
| 20 #elif V8_TARGET_ARCH_MIPS64 | |
| 21 #include "src/mips64/lithium-mips64.h" // NOLINT | |
| 22 #elif V8_TARGET_ARCH_X87 | 45 #elif V8_TARGET_ARCH_X87 | 
| 23 #include "src/x87/lithium-x87.h" // NOLINT | 46 #include "src/x87/lithium-x87.h" // NOLINT | 
| 24 #else | 47 #else | 
| 25 #error "Unknown architecture." | 48 #error "Unknown architecture." | 
| 26 #endif | 49 #endif | 
| 27 | 50 | 
| 28 namespace v8 { | 51 namespace v8 { | 
| 29 namespace internal { | 52 namespace internal { | 
| 30 | 53 | 
| 31 bool LAllocator::IsGapAt(int index) { return chunk_->IsGapAt(index); } | |
| 32 | |
| 33 | |
| 34 LInstruction* LAllocator::InstructionAt(int index) { | |
| 35 return chunk_->instructions()->at(index); | |
| 36 } | |
| 37 | |
| 38 | |
| 39 LGap* LAllocator::GapAt(int index) { | |
| 40 return chunk_->GetGapAt(index); | |
| 41 } | |
| 42 | |
| 43 | |
| 44 TempIterator::TempIterator(LInstruction* instr) | 54 TempIterator::TempIterator(LInstruction* instr) | 
| 45 : instr_(instr), | 55 : instr_(instr), | 
| 46 limit_(instr->TempCount()), | 56 limit_(instr->TempCount()), | 
| 47 current_(0) { | 57 current_(0) { | 
| 48 SkipUninteresting(); | 58 SkipUninteresting(); | 
| 49 } | 59 } | 
| 50 | 60 | 
| 51 | 61 | 
| 52 bool TempIterator::Done() { return current_ >= limit_; } | 62 bool TempIterator::Done() { return current_ >= limit_; } | 
| 53 | 63 | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 } | 131 } | 
| 122 | 132 | 
| 123 | 133 | 
| 124 void UseIterator::Advance() { | 134 void UseIterator::Advance() { | 
| 125 input_iterator_.Done() | 135 input_iterator_.Done() | 
| 126 ? env_iterator_.Advance() | 136 ? env_iterator_.Advance() | 
| 127 : input_iterator_.Advance(); | 137 : input_iterator_.Advance(); | 
| 128 } | 138 } | 
| 129 | 139 | 
| 130 | 140 | 
| 131 void LAllocator::SetLiveRangeAssignedRegister(LiveRange* range, int reg) { | |
| 132 if (range->Kind() == DOUBLE_REGISTERS) { | |
| 133 assigned_double_registers_->Add(reg); | |
| 134 } else { | |
| 135 ASSERT(range->Kind() == GENERAL_REGISTERS); | |
| 136 assigned_registers_->Add(reg); | |
| 137 } | |
| 138 range->set_assigned_register(reg, chunk()->zone()); | |
| 139 } | |
| 140 | |
| 141 | |
| 142 } } // namespace v8::internal | 141 } } // namespace v8::internal | 
| 143 | 142 | 
| 144 #endif // V8_LITHIUM_ALLOCATOR_INL_H_ | 143 #endif // V8_LITHIUM_INL_H_ | 
| OLD | NEW |