| 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_CODEGEN_ARM64_H_ | 5 #ifndef V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
| 6 #define V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 6 #define V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
| 7 | 7 |
| 8 #include "src/arm64/lithium-arm64.h" | 8 #include "src/arm64/lithium-arm64.h" |
| 9 | 9 |
| 10 #include "src/arm64/lithium-gap-resolver-arm64.h" | 10 #include "src/arm64/lithium-gap-resolver-arm64.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 jump_table_(4, info->zone()), | 30 jump_table_(4, info->zone()), |
| 31 deoptimization_literals_(8, info->zone()), | 31 deoptimization_literals_(8, info->zone()), |
| 32 inlined_function_count_(0), | 32 inlined_function_count_(0), |
| 33 scope_(info->scope()), | 33 scope_(info->scope()), |
| 34 translations_(info->zone()), | 34 translations_(info->zone()), |
| 35 deferred_(8, info->zone()), | 35 deferred_(8, info->zone()), |
| 36 osr_pc_offset_(-1), | 36 osr_pc_offset_(-1), |
| 37 frame_is_built_(false), | 37 frame_is_built_(false), |
| 38 safepoints_(info->zone()), | 38 safepoints_(info->zone()), |
| 39 resolver_(this), | 39 resolver_(this), |
| 40 expected_safepoint_kind_(Safepoint::kSimple) { | 40 expected_safepoint_kind_(Safepoint::kSimple), |
| 41 pushed_arguments_(0) { |
| 41 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 42 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
| 42 } | 43 } |
| 43 | 44 |
| 44 // Simple accessors. | 45 // Simple accessors. |
| 45 Scope* scope() const { return scope_; } | 46 Scope* scope() const { return scope_; } |
| 46 | 47 |
| 47 int LookupDestination(int block_id) const { | 48 int LookupDestination(int block_id) const { |
| 48 return chunk()->LookupDestination(block_id); | 49 return chunk()->LookupDestination(block_id); |
| 49 } | 50 } |
| 50 | 51 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 74 // Finish the code by setting stack height, safepoint, and bailout | 75 // Finish the code by setting stack height, safepoint, and bailout |
| 75 // information on it. | 76 // information on it. |
| 76 void FinishCode(Handle<Code> code); | 77 void FinishCode(Handle<Code> code); |
| 77 | 78 |
| 78 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; | 79 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; |
| 79 // Support for converting LOperands to assembler types. | 80 // Support for converting LOperands to assembler types. |
| 80 Register ToRegister(LOperand* op) const; | 81 Register ToRegister(LOperand* op) const; |
| 81 Register ToRegister32(LOperand* op) const; | 82 Register ToRegister32(LOperand* op) const; |
| 82 Operand ToOperand(LOperand* op); | 83 Operand ToOperand(LOperand* op); |
| 83 Operand ToOperand32(LOperand* op); | 84 Operand ToOperand32(LOperand* op); |
| 84 MemOperand ToMemOperand(LOperand* op) const; | 85 enum StackMode { kMustUseFramePointer, kCanUseStackPointer }; |
| 86 MemOperand ToMemOperand(LOperand* op, |
| 87 StackMode stack_mode = kCanUseStackPointer) const; |
| 85 Handle<Object> ToHandle(LConstantOperand* op) const; | 88 Handle<Object> ToHandle(LConstantOperand* op) const; |
| 86 | 89 |
| 87 template <class LI> | 90 template <class LI> |
| 88 Operand ToShiftedRightOperand32(LOperand* right, LI* shift_info); | 91 Operand ToShiftedRightOperand32(LOperand* right, LI* shift_info); |
| 89 | 92 |
| 90 int JSShiftAmountFromLConstant(LOperand* constant) { | 93 int JSShiftAmountFromLConstant(LOperand* constant) { |
| 91 return ToInteger32(LConstantOperand::cast(constant)) & 0x1f; | 94 return ToInteger32(LConstantOperand::cast(constant)) & 0x1f; |
| 92 } | 95 } |
| 93 | 96 |
| 94 // TODO(jbramley): Examine these helpers and check that they make sense. | 97 // TODO(jbramley): Examine these helpers and check that they make sense. |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 354 |
| 352 // Builder that keeps track of safepoints in the code. The table itself is | 355 // Builder that keeps track of safepoints in the code. The table itself is |
| 353 // emitted at the end of the generated code. | 356 // emitted at the end of the generated code. |
| 354 SafepointTableBuilder safepoints_; | 357 SafepointTableBuilder safepoints_; |
| 355 | 358 |
| 356 // Compiler from a set of parallel moves to a sequential list of moves. | 359 // Compiler from a set of parallel moves to a sequential list of moves. |
| 357 LGapResolver resolver_; | 360 LGapResolver resolver_; |
| 358 | 361 |
| 359 Safepoint::Kind expected_safepoint_kind_; | 362 Safepoint::Kind expected_safepoint_kind_; |
| 360 | 363 |
| 364 // The number of arguments pushed onto the stack, either by this block or by a |
| 365 // predecessor. |
| 366 int pushed_arguments_; |
| 367 |
| 368 void RecordPushedArgumentsDelta(int delta) { |
| 369 pushed_arguments_ += delta; |
| 370 DCHECK(pushed_arguments_ >= 0); |
| 371 } |
| 372 |
| 361 int old_position_; | 373 int old_position_; |
| 362 | 374 |
| 363 class PushSafepointRegistersScope BASE_EMBEDDED { | 375 class PushSafepointRegistersScope BASE_EMBEDDED { |
| 364 public: | 376 public: |
| 365 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 377 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
| 366 : codegen_(codegen) { | 378 : codegen_(codegen) { |
| 367 DCHECK(codegen_->info()->is_calling()); | 379 DCHECK(codegen_->info()->is_calling()); |
| 368 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 380 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| 369 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 381 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
| 370 | 382 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 457 |
| 446 protected: | 458 protected: |
| 447 MacroAssembler* masm() const { return codegen_->masm(); } | 459 MacroAssembler* masm() const { return codegen_->masm(); } |
| 448 | 460 |
| 449 LCodeGen* codegen_; | 461 LCodeGen* codegen_; |
| 450 }; | 462 }; |
| 451 | 463 |
| 452 } } // namespace v8::internal | 464 } } // namespace v8::internal |
| 453 | 465 |
| 454 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ | 466 #endif // V8_ARM64_LITHIUM_CODEGEN_ARM64_H_ |
| OLD | NEW |