OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 info()->requires_frame(); | 98 info()->requires_frame(); |
99 } | 99 } |
100 bool NeedsDeferredFrame() const { | 100 bool NeedsDeferredFrame() const { |
101 return !NeedsEagerFrame() && info()->is_deferred_calling(); | 101 return !NeedsEagerFrame() && info()->is_deferred_calling(); |
102 } | 102 } |
103 | 103 |
104 // Support for converting LOperands to assembler types. | 104 // Support for converting LOperands to assembler types. |
105 Operand ToOperand(LOperand* op) const; | 105 Operand ToOperand(LOperand* op) const; |
106 Register ToRegister(LOperand* op) const; | 106 Register ToRegister(LOperand* op) const; |
107 XMMRegister ToDoubleRegister(LOperand* op) const; | 107 XMMRegister ToDoubleRegister(LOperand* op) const; |
108 bool IsX87TopOfStack(LOperand* op) const; | 108 X87Register ToX87Register(LOperand* op) const; |
109 | 109 |
110 bool IsInteger32(LConstantOperand* op) const; | 110 bool IsInteger32(LConstantOperand* op) const; |
111 bool IsSmi(LConstantOperand* op) const; | 111 bool IsSmi(LConstantOperand* op) const; |
112 Immediate ToInteger32Immediate(LOperand* op) const { | 112 Immediate ToInteger32Immediate(LOperand* op) const { |
113 return Immediate(ToInteger32(LConstantOperand::cast(op))); | 113 return Immediate(ToInteger32(LConstantOperand::cast(op))); |
114 } | 114 } |
115 Immediate ToSmiImmediate(LOperand* op) const { | 115 Immediate ToSmiImmediate(LOperand* op) const { |
116 return Immediate(Smi::FromInt(ToInteger32(LConstantOperand::cast(op)))); | 116 return Immediate(Smi::FromInt(ToInteger32(LConstantOperand::cast(op)))); |
117 } | 117 } |
118 | 118 |
119 // Support for non-sse2 (x87) floating point stack handling. | 119 // Support for non-sse2 (x87) floating point stack handling. |
120 // These functions maintain the depth of the stack (either 0 or 1) | 120 // These functions maintain the depth of the stack (either 0 or 1) |
121 void PushX87DoubleOperand(Operand src); | 121 enum X87OperandType { kX87DoubleOperand, kX87FloatOperand, kX87IntOperand }; |
mvstanton
2013/07/04 12:30:55
Maybe update the comment above, it's out of date n
| |
122 void PushX87FloatOperand(Operand src); | 122 |
123 void ReadX87Operand(Operand dst); | 123 void X87Mov(X87Register reg, Operand src, |
124 bool X87StackNonEmpty() const { return x87_stack_depth_ > 0; } | 124 X87OperandType operand = kX87DoubleOperand); |
125 void PopX87(); | 125 void X87Mov(Operand src, X87Register reg); |
126 void CurrentInstructionReturnsX87Result(); | 126 |
127 void FlushX87StackIfNecessary(LInstruction* instr); | 127 void X87PrepareBinaryOp( |
128 X87Register left, X87Register right, X87Register result); | |
129 | |
130 void X87LoadForUsage(X87Register reg); | |
131 void X87PrepareToWrite(X87Register reg); | |
132 void X87CommitWrite(X87Register reg); | |
128 | 133 |
129 Handle<Object> ToHandle(LConstantOperand* op) const; | 134 Handle<Object> ToHandle(LConstantOperand* op) const; |
130 | 135 |
131 // The operand denoting the second word (the one with a higher address) of | 136 // The operand denoting the second word (the one with a higher address) of |
132 // a double stack slot. | 137 // a double stack slot. |
133 Operand HighOperand(LOperand* op); | 138 Operand HighOperand(LOperand* op); |
134 | 139 |
135 // Try to generate code for the entire chunk, but it may fail if the | 140 // Try to generate code for the entire chunk, but it may fail if the |
136 // chunk contains constructs we cannot handle. Returns true if the | 141 // chunk contains constructs we cannot handle. Returns true if the |
137 // code generation attempt succeeded. | 142 // code generation attempt succeeded. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 bool is_tagged, | 289 bool is_tagged, |
285 bool is_uint32); | 290 bool is_uint32); |
286 void RegisterDependentCodeForEmbeddedMaps(Handle<Code> code); | 291 void RegisterDependentCodeForEmbeddedMaps(Handle<Code> code); |
287 void PopulateDeoptimizationData(Handle<Code> code); | 292 void PopulateDeoptimizationData(Handle<Code> code); |
288 int DefineDeoptimizationLiteral(Handle<Object> literal); | 293 int DefineDeoptimizationLiteral(Handle<Object> literal); |
289 | 294 |
290 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 295 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
291 | 296 |
292 Register ToRegister(int index) const; | 297 Register ToRegister(int index) const; |
293 XMMRegister ToDoubleRegister(int index) const; | 298 XMMRegister ToDoubleRegister(int index) const; |
299 X87Register ToX87Register(int index) const; | |
294 int ToInteger32(LConstantOperand* op) const; | 300 int ToInteger32(LConstantOperand* op) const; |
295 | 301 |
296 double ToDouble(LConstantOperand* op) const; | 302 double ToDouble(LConstantOperand* op) const; |
297 Operand BuildFastArrayOperand(LOperand* elements_pointer, | 303 Operand BuildFastArrayOperand(LOperand* elements_pointer, |
298 LOperand* key, | 304 LOperand* key, |
299 Representation key_representation, | 305 Representation key_representation, |
300 ElementsKind elements_kind, | 306 ElementsKind elements_kind, |
301 uint32_t offset, | 307 uint32_t offset, |
302 uint32_t additional_index = 0); | 308 uint32_t additional_index = 0); |
303 | 309 |
(...skipping 20 matching lines...) Expand all Loading... | |
324 Register temp, | 330 Register temp, |
325 XMMRegister result, | 331 XMMRegister result, |
326 bool allow_undefined_as_nan, | 332 bool allow_undefined_as_nan, |
327 bool deoptimize_on_minus_zero, | 333 bool deoptimize_on_minus_zero, |
328 LEnvironment* env, | 334 LEnvironment* env, |
329 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); | 335 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); |
330 | 336 |
331 void EmitNumberUntagDNoSSE2( | 337 void EmitNumberUntagDNoSSE2( |
332 Register input, | 338 Register input, |
333 Register temp, | 339 Register temp, |
340 X87Register res_reg, | |
334 bool allow_undefined_as_nan, | 341 bool allow_undefined_as_nan, |
335 bool deoptimize_on_minus_zero, | 342 bool deoptimize_on_minus_zero, |
336 LEnvironment* env, | 343 LEnvironment* env, |
337 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); | 344 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); |
338 | 345 |
339 // Emits optimized code for typeof x == "y". Modifies input register. | 346 // Emits optimized code for typeof x == "y". Modifies input register. |
340 // Returns the condition on which a final split to | 347 // Returns the condition on which a final split to |
341 // true and false label should be made, to optimize fallthrough. | 348 // true and false label should be made, to optimize fallthrough. |
342 Condition EmitTypeofIs(Label* true_label, | 349 Condition EmitTypeofIs(Label* true_label, |
343 Label* false_label, | 350 Label* false_label, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
385 void DoStoreKeyedExternalArray(LStoreKeyed* instr); | 392 void DoStoreKeyedExternalArray(LStoreKeyed* instr); |
386 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); | 393 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); |
387 void DoStoreKeyedFixedArray(LStoreKeyed* instr); | 394 void DoStoreKeyedFixedArray(LStoreKeyed* instr); |
388 | 395 |
389 void EmitReturn(LReturn* instr, bool dynamic_frame_alignment); | 396 void EmitReturn(LReturn* instr, bool dynamic_frame_alignment); |
390 | 397 |
391 // Emits code for pushing either a tagged constant, a (non-double) | 398 // Emits code for pushing either a tagged constant, a (non-double) |
392 // register, or a stack slot operand. | 399 // register, or a stack slot operand. |
393 void EmitPushTaggedOperand(LOperand* operand); | 400 void EmitPushTaggedOperand(LOperand* operand); |
394 | 401 |
402 void X87Fxch(X87Register reg, int other_slot = 0); | |
403 void X87Fld(Operand src, X87OperandType opts); | |
404 void X87Free(X87Register reg); | |
405 | |
406 void FlushX87StackIfNecessary(LInstruction* instr); | |
407 bool X87StackContains(X87Register reg); | |
408 int X87ArrayIndex(X87Register reg); | |
409 int x87_st2idx(int pos); | |
410 | |
395 Zone* zone_; | 411 Zone* zone_; |
396 LPlatformChunk* const chunk_; | 412 LPlatformChunk* const chunk_; |
397 MacroAssembler* const masm_; | 413 MacroAssembler* const masm_; |
398 CompilationInfo* const info_; | 414 CompilationInfo* const info_; |
399 | 415 |
400 int current_block_; | 416 int current_block_; |
401 int current_instruction_; | 417 int current_instruction_; |
402 const ZoneList<LInstruction*>* instructions_; | 418 const ZoneList<LInstruction*>* instructions_; |
403 ZoneList<LEnvironment*> deoptimizations_; | 419 ZoneList<LEnvironment*> deoptimizations_; |
404 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; | 420 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; |
405 ZoneList<Handle<Object> > deoptimization_literals_; | 421 ZoneList<Handle<Object> > deoptimization_literals_; |
406 int inlined_function_count_; | 422 int inlined_function_count_; |
407 Scope* const scope_; | 423 Scope* const scope_; |
408 Status status_; | 424 Status status_; |
409 TranslationBuffer translations_; | 425 TranslationBuffer translations_; |
410 ZoneList<LDeferredCode*> deferred_; | 426 ZoneList<LDeferredCode*> deferred_; |
411 bool dynamic_frame_alignment_; | 427 bool dynamic_frame_alignment_; |
412 bool support_aligned_spilled_doubles_; | 428 bool support_aligned_spilled_doubles_; |
413 int osr_pc_offset_; | 429 int osr_pc_offset_; |
414 int last_lazy_deopt_pc_; | 430 int last_lazy_deopt_pc_; |
415 bool frame_is_built_; | 431 bool frame_is_built_; |
432 X87Register x87_stack_[8]; | |
mvstanton
2013/07/04 12:30:55
Can you replace the constant with something more o
| |
416 int x87_stack_depth_; | 433 int x87_stack_depth_; |
417 | 434 |
418 // Builder that keeps track of safepoints in the code. The table | 435 // Builder that keeps track of safepoints in the code. The table |
419 // itself is emitted at the end of the generated code. | 436 // itself is emitted at the end of the generated code. |
420 SafepointTableBuilder safepoints_; | 437 SafepointTableBuilder safepoints_; |
421 | 438 |
422 // Compiler from a set of parallel moves to a sequential list of moves. | 439 // Compiler from a set of parallel moves to a sequential list of moves. |
423 LGapResolver resolver_; | 440 LGapResolver resolver_; |
424 | 441 |
425 Safepoint::Kind expected_safepoint_kind_; | 442 Safepoint::Kind expected_safepoint_kind_; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 LCodeGen* codegen_; | 494 LCodeGen* codegen_; |
478 Label entry_; | 495 Label entry_; |
479 Label exit_; | 496 Label exit_; |
480 Label* external_exit_; | 497 Label* external_exit_; |
481 int instruction_index_; | 498 int instruction_index_; |
482 }; | 499 }; |
483 | 500 |
484 } } // namespace v8::internal | 501 } } // namespace v8::internal |
485 | 502 |
486 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ | 503 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ |
OLD | NEW |