OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_X87_LITHIUM_CODEGEN_X87_H_ | 5 #ifndef V8_X87_LITHIUM_CODEGEN_X87_H_ |
6 #define V8_X87_LITHIUM_CODEGEN_X87_H_ | 6 #define V8_X87_LITHIUM_CODEGEN_X87_H_ |
7 | 7 |
8 #include "src/x87/lithium-x87.h" | 8 #include "src/x87/lithium-x87.h" |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 Register input, | 167 Register input, |
168 Register temporary, | 168 Register temporary, |
169 Register temporary2); | 169 Register temporary2); |
170 | 170 |
171 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 171 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
172 | 172 |
173 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } | 173 void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); } |
174 | 174 |
175 // Code generation passes. Returns true if code generation should | 175 // Code generation passes. Returns true if code generation should |
176 // continue. | 176 // continue. |
177 void GenerateBodyInstructionPre(LInstruction* instr) V8_OVERRIDE; | 177 void GenerateBodyInstructionPre(LInstruction* instr) OVERRIDE; |
178 void GenerateBodyInstructionPost(LInstruction* instr) V8_OVERRIDE; | 178 void GenerateBodyInstructionPost(LInstruction* instr) OVERRIDE; |
179 bool GeneratePrologue(); | 179 bool GeneratePrologue(); |
180 bool GenerateDeferredCode(); | 180 bool GenerateDeferredCode(); |
181 bool GenerateJumpTable(); | 181 bool GenerateJumpTable(); |
182 bool GenerateSafepointTable(); | 182 bool GenerateSafepointTable(); |
183 | 183 |
184 // Generates the custom OSR entrypoint and sets the osr_pc_offset. | 184 // Generates the custom OSR entrypoint and sets the osr_pc_offset. |
185 void GenerateOsrPrologue(); | 185 void GenerateOsrPrologue(); |
186 | 186 |
187 enum SafepointMode { | 187 enum SafepointMode { |
188 RECORD_SIMPLE_SAFEPOINT, | 188 RECORD_SIMPLE_SAFEPOINT, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 void RecordSafepoint(LPointerMap* pointers, | 277 void RecordSafepoint(LPointerMap* pointers, |
278 Safepoint::Kind kind, | 278 Safepoint::Kind kind, |
279 int arguments, | 279 int arguments, |
280 Safepoint::DeoptMode mode); | 280 Safepoint::DeoptMode mode); |
281 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); | 281 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
282 void RecordSafepoint(Safepoint::DeoptMode mode); | 282 void RecordSafepoint(Safepoint::DeoptMode mode); |
283 void RecordSafepointWithRegisters(LPointerMap* pointers, | 283 void RecordSafepointWithRegisters(LPointerMap* pointers, |
284 int arguments, | 284 int arguments, |
285 Safepoint::DeoptMode mode); | 285 Safepoint::DeoptMode mode); |
286 | 286 |
287 void RecordAndWritePosition(int position) V8_OVERRIDE; | 287 void RecordAndWritePosition(int position) OVERRIDE; |
288 | 288 |
289 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 289 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
290 void EmitGoto(int block); | 290 void EmitGoto(int block); |
291 | 291 |
292 // EmitBranch expects to be the last instruction of a block. | 292 // EmitBranch expects to be the last instruction of a block. |
293 template<class InstrType> | 293 template<class InstrType> |
294 void EmitBranch(InstrType instr, Condition cc); | 294 void EmitBranch(InstrType instr, Condition cc); |
295 template<class InstrType> | 295 template<class InstrType> |
296 void EmitFalseBranch(InstrType instr, Condition cc); | 296 void EmitFalseBranch(InstrType instr, Condition cc); |
297 void EmitNumberUntagDNoSSE2( | 297 void EmitNumberUntagDNoSSE2( |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 void EmitIsConstructCall(Register temp); | 329 void EmitIsConstructCall(Register temp); |
330 | 330 |
331 // Emits optimized code to deep-copy the contents of statically known | 331 // Emits optimized code to deep-copy the contents of statically known |
332 // object graphs (e.g. object literal boilerplate). | 332 // object graphs (e.g. object literal boilerplate). |
333 void EmitDeepCopy(Handle<JSObject> object, | 333 void EmitDeepCopy(Handle<JSObject> object, |
334 Register result, | 334 Register result, |
335 Register source, | 335 Register source, |
336 int* offset, | 336 int* offset, |
337 AllocationSiteMode mode); | 337 AllocationSiteMode mode); |
338 | 338 |
339 void EnsureSpaceForLazyDeopt(int space_needed) V8_OVERRIDE; | 339 void EnsureSpaceForLazyDeopt(int space_needed) OVERRIDE; |
340 void DoLoadKeyedExternalArray(LLoadKeyed* instr); | 340 void DoLoadKeyedExternalArray(LLoadKeyed* instr); |
341 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); | 341 void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr); |
342 void DoLoadKeyedFixedArray(LLoadKeyed* instr); | 342 void DoLoadKeyedFixedArray(LLoadKeyed* instr); |
343 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 343 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
344 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 344 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
345 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 345 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
346 | 346 |
347 template <class T> | 347 template <class T> |
348 void EmitVectorLoadICRegisters(T* instr); | 348 void EmitVectorLoadICRegisters(T* instr); |
349 | 349 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 // Builder that keeps track of safepoints in the code. The table | 434 // Builder that keeps track of safepoints in the code. The table |
435 // itself is emitted at the end of the generated code. | 435 // itself is emitted at the end of the generated code. |
436 SafepointTableBuilder safepoints_; | 436 SafepointTableBuilder safepoints_; |
437 | 437 |
438 // Compiler from a set of parallel moves to a sequential list of moves. | 438 // Compiler from a set of parallel moves to a sequential list of moves. |
439 LGapResolver resolver_; | 439 LGapResolver resolver_; |
440 | 440 |
441 Safepoint::Kind expected_safepoint_kind_; | 441 Safepoint::Kind expected_safepoint_kind_; |
442 | 442 |
443 class PushSafepointRegistersScope V8_FINAL BASE_EMBEDDED { | 443 class PushSafepointRegistersScope FINAL BASE_EMBEDDED { |
444 public: | 444 public: |
445 explicit PushSafepointRegistersScope(LCodeGen* codegen) | 445 explicit PushSafepointRegistersScope(LCodeGen* codegen) |
446 : codegen_(codegen) { | 446 : codegen_(codegen) { |
447 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 447 DCHECK(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
448 codegen_->masm_->PushSafepointRegisters(); | 448 codegen_->masm_->PushSafepointRegisters(); |
449 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; | 449 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters; |
450 DCHECK(codegen_->info()->is_calling()); | 450 DCHECK(codegen_->info()->is_calling()); |
451 } | 451 } |
452 | 452 |
453 ~PushSafepointRegistersScope() { | 453 ~PushSafepointRegistersScope() { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 Label exit_; | 498 Label exit_; |
499 Label* external_exit_; | 499 Label* external_exit_; |
500 Label done_; | 500 Label done_; |
501 int instruction_index_; | 501 int instruction_index_; |
502 LCodeGen::X87Stack x87_stack_; | 502 LCodeGen::X87Stack x87_stack_; |
503 }; | 503 }; |
504 | 504 |
505 } } // namespace v8::internal | 505 } } // namespace v8::internal |
506 | 506 |
507 #endif // V8_X87_LITHIUM_CODEGEN_X87_H_ | 507 #endif // V8_X87_LITHIUM_CODEGEN_X87_H_ |
OLD | NEW |