OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_ARM64_LITHIUM_ARM64_H_ | 5 #ifndef V8_ARM64_LITHIUM_ARM64_H_ |
6 #define V8_ARM64_LITHIUM_ARM64_H_ | 6 #define V8_ARM64_LITHIUM_ARM64_H_ |
7 | 7 |
8 #include "src/hydrogen.h" | 8 #include "src/hydrogen.h" |
9 #include "src/lithium.h" | 9 #include "src/lithium.h" |
10 #include "src/lithium-allocator.h" | 10 #include "src/lithium-allocator.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 179 |
180 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 180 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
181 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ | 181 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ |
182 return LInstruction::k##type; \ | 182 return LInstruction::k##type; \ |
183 } \ | 183 } \ |
184 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ | 184 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ |
185 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ | 185 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ |
186 return mnemonic; \ | 186 return mnemonic; \ |
187 } \ | 187 } \ |
188 static L##type* cast(LInstruction* instr) { \ | 188 static L##type* cast(LInstruction* instr) { \ |
189 ASSERT(instr->Is##type()); \ | 189 DCHECK(instr->Is##type()); \ |
190 return reinterpret_cast<L##type*>(instr); \ | 190 return reinterpret_cast<L##type*>(instr); \ |
191 } | 191 } |
192 | 192 |
193 | 193 |
194 #define DECLARE_HYDROGEN_ACCESSOR(type) \ | 194 #define DECLARE_HYDROGEN_ACCESSOR(type) \ |
195 H##type* hydrogen() const { \ | 195 H##type* hydrogen() const { \ |
196 return H##type::cast(this->hydrogen_value()); \ | 196 return H##type::cast(this->hydrogen_value()); \ |
197 } | 197 } |
198 | 198 |
199 | 199 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 parallel_moves_[BEFORE] = NULL; | 384 parallel_moves_[BEFORE] = NULL; |
385 parallel_moves_[START] = NULL; | 385 parallel_moves_[START] = NULL; |
386 parallel_moves_[END] = NULL; | 386 parallel_moves_[END] = NULL; |
387 parallel_moves_[AFTER] = NULL; | 387 parallel_moves_[AFTER] = NULL; |
388 } | 388 } |
389 | 389 |
390 // Can't use the DECLARE-macro here because of sub-classes. | 390 // Can't use the DECLARE-macro here because of sub-classes. |
391 virtual bool IsGap() const V8_OVERRIDE { return true; } | 391 virtual bool IsGap() const V8_OVERRIDE { return true; } |
392 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 392 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
393 static LGap* cast(LInstruction* instr) { | 393 static LGap* cast(LInstruction* instr) { |
394 ASSERT(instr->IsGap()); | 394 DCHECK(instr->IsGap()); |
395 return reinterpret_cast<LGap*>(instr); | 395 return reinterpret_cast<LGap*>(instr); |
396 } | 396 } |
397 | 397 |
398 bool IsRedundant() const; | 398 bool IsRedundant() const; |
399 | 399 |
400 HBasicBlock* block() const { return block_; } | 400 HBasicBlock* block() const { return block_; } |
401 | 401 |
402 enum InnerPosition { | 402 enum InnerPosition { |
403 BEFORE, | 403 BEFORE, |
404 START, | 404 START, |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1521 }; | 1521 }; |
1522 | 1522 |
1523 | 1523 |
1524 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { | 1524 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { |
1525 public: | 1525 public: |
1526 LCallWithDescriptor(const InterfaceDescriptor* descriptor, | 1526 LCallWithDescriptor(const InterfaceDescriptor* descriptor, |
1527 const ZoneList<LOperand*>& operands, | 1527 const ZoneList<LOperand*>& operands, |
1528 Zone* zone) | 1528 Zone* zone) |
1529 : descriptor_(descriptor), | 1529 : descriptor_(descriptor), |
1530 inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { | 1530 inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { |
1531 ASSERT(descriptor->GetRegisterParameterCount() + 1 == operands.length()); | 1531 DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); |
1532 inputs_.AddAll(operands, zone); | 1532 inputs_.AddAll(operands, zone); |
1533 } | 1533 } |
1534 | 1534 |
1535 LOperand* target() const { return inputs_[0]; } | 1535 LOperand* target() const { return inputs_[0]; } |
1536 | 1536 |
1537 const InterfaceDescriptor* descriptor() { return descriptor_; } | 1537 const InterfaceDescriptor* descriptor() { return descriptor_; } |
1538 | 1538 |
1539 private: | 1539 private: |
1540 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") | 1540 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") |
1541 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) | 1541 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2341 inputs_[2] = parameter_count; | 2341 inputs_[2] = parameter_count; |
2342 } | 2342 } |
2343 | 2343 |
2344 LOperand* value() { return inputs_[0]; } | 2344 LOperand* value() { return inputs_[0]; } |
2345 LOperand* parameter_count() { return inputs_[2]; } | 2345 LOperand* parameter_count() { return inputs_[2]; } |
2346 | 2346 |
2347 bool has_constant_parameter_count() { | 2347 bool has_constant_parameter_count() { |
2348 return parameter_count()->IsConstantOperand(); | 2348 return parameter_count()->IsConstantOperand(); |
2349 } | 2349 } |
2350 LConstantOperand* constant_parameter_count() { | 2350 LConstantOperand* constant_parameter_count() { |
2351 ASSERT(has_constant_parameter_count()); | 2351 DCHECK(has_constant_parameter_count()); |
2352 return LConstantOperand::cast(parameter_count()); | 2352 return LConstantOperand::cast(parameter_count()); |
2353 } | 2353 } |
2354 | 2354 |
2355 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 2355 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
2356 }; | 2356 }; |
2357 | 2357 |
2358 | 2358 |
2359 class LSeqStringGetChar V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 2359 class LSeqStringGetChar V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
2360 public: | 2360 public: |
2361 LSeqStringGetChar(LOperand* string, | 2361 LSeqStringGetChar(LOperand* string, |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2484 this->elements()->PrintTo(stream); | 2484 this->elements()->PrintTo(stream); |
2485 stream->Add("["); | 2485 stream->Add("["); |
2486 this->key()->PrintTo(stream); | 2486 this->key()->PrintTo(stream); |
2487 if (this->base_offset() != 0) { | 2487 if (this->base_offset() != 0) { |
2488 stream->Add(" + %d] <-", this->base_offset()); | 2488 stream->Add(" + %d] <-", this->base_offset()); |
2489 } else { | 2489 } else { |
2490 stream->Add("] <- "); | 2490 stream->Add("] <- "); |
2491 } | 2491 } |
2492 | 2492 |
2493 if (this->value() == NULL) { | 2493 if (this->value() == NULL) { |
2494 ASSERT(hydrogen()->IsConstantHoleStore() && | 2494 DCHECK(hydrogen()->IsConstantHoleStore() && |
2495 hydrogen()->value()->representation().IsDouble()); | 2495 hydrogen()->value()->representation().IsDouble()); |
2496 stream->Add("<the hole(nan)>"); | 2496 stream->Add("<the hole(nan)>"); |
2497 } else { | 2497 } else { |
2498 this->value()->PrintTo(stream); | 2498 this->value()->PrintTo(stream); |
2499 } | 2499 } |
2500 } | 2500 } |
2501 | 2501 |
2502 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2502 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2503 }; | 2503 }; |
2504 | 2504 |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3213 void AddInstruction(LInstruction* instr, HInstruction* current); | 3213 void AddInstruction(LInstruction* instr, HInstruction* current); |
3214 void DoBasicBlock(HBasicBlock* block); | 3214 void DoBasicBlock(HBasicBlock* block); |
3215 | 3215 |
3216 int JSShiftAmountFromHConstant(HValue* constant) { | 3216 int JSShiftAmountFromHConstant(HValue* constant) { |
3217 return HConstant::cast(constant)->Integer32Value() & 0x1f; | 3217 return HConstant::cast(constant)->Integer32Value() & 0x1f; |
3218 } | 3218 } |
3219 bool LikelyFitsImmField(HInstruction* instr, int imm) { | 3219 bool LikelyFitsImmField(HInstruction* instr, int imm) { |
3220 if (instr->IsAdd() || instr->IsSub()) { | 3220 if (instr->IsAdd() || instr->IsSub()) { |
3221 return Assembler::IsImmAddSub(imm) || Assembler::IsImmAddSub(-imm); | 3221 return Assembler::IsImmAddSub(imm) || Assembler::IsImmAddSub(-imm); |
3222 } else { | 3222 } else { |
3223 ASSERT(instr->IsBitwise()); | 3223 DCHECK(instr->IsBitwise()); |
3224 unsigned unused_n, unused_imm_s, unused_imm_r; | 3224 unsigned unused_n, unused_imm_s, unused_imm_r; |
3225 return Assembler::IsImmLogical(imm, kWRegSizeInBits, | 3225 return Assembler::IsImmLogical(imm, kWRegSizeInBits, |
3226 &unused_n, &unused_imm_s, &unused_imm_r); | 3226 &unused_n, &unused_imm_s, &unused_imm_r); |
3227 } | 3227 } |
3228 } | 3228 } |
3229 | 3229 |
3230 // Indicates if a sequence of the form | 3230 // Indicates if a sequence of the form |
3231 // lsl x8, x9, #imm | 3231 // lsl x8, x9, #imm |
3232 // add x0, x1, x8 | 3232 // add x0, x1, x8 |
3233 // can be replaced with: | 3233 // can be replaced with: |
(...skipping 28 matching lines...) Expand all Loading... |
3262 | 3262 |
3263 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 3263 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
3264 }; | 3264 }; |
3265 | 3265 |
3266 #undef DECLARE_HYDROGEN_ACCESSOR | 3266 #undef DECLARE_HYDROGEN_ACCESSOR |
3267 #undef DECLARE_CONCRETE_INSTRUCTION | 3267 #undef DECLARE_CONCRETE_INSTRUCTION |
3268 | 3268 |
3269 } } // namespace v8::internal | 3269 } } // namespace v8::internal |
3270 | 3270 |
3271 #endif // V8_ARM64_LITHIUM_ARM64_H_ | 3271 #endif // V8_ARM64_LITHIUM_ARM64_H_ |
OLD | NEW |