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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 inlined_function_count_(0), | 61 inlined_function_count_(0), |
62 scope_(info->scope()), | 62 scope_(info->scope()), |
63 status_(UNUSED), | 63 status_(UNUSED), |
64 translations_(info->zone()), | 64 translations_(info->zone()), |
65 deferred_(8, info->zone()), | 65 deferred_(8, info->zone()), |
66 dynamic_frame_alignment_(false), | 66 dynamic_frame_alignment_(false), |
67 support_aligned_spilled_doubles_(false), | 67 support_aligned_spilled_doubles_(false), |
68 osr_pc_offset_(-1), | 68 osr_pc_offset_(-1), |
69 last_lazy_deopt_pc_(0), | 69 last_lazy_deopt_pc_(0), |
70 frame_is_built_(false), | 70 frame_is_built_(false), |
| 71 x87_stack_depth_(0), |
71 safepoints_(info->zone()), | 72 safepoints_(info->zone()), |
72 resolver_(this), | 73 resolver_(this), |
73 expected_safepoint_kind_(Safepoint::kSimple) { | 74 expected_safepoint_kind_(Safepoint::kSimple) { |
74 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 75 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
75 } | 76 } |
76 | 77 |
77 // Simple accessors. | 78 // Simple accessors. |
78 MacroAssembler* masm() const { return masm_; } | 79 MacroAssembler* masm() const { return masm_; } |
79 CompilationInfo* info() const { return info_; } | 80 CompilationInfo* info() const { return info_; } |
80 Isolate* isolate() const { return info_->isolate(); } | 81 Isolate* isolate() const { return info_->isolate(); } |
(...skipping 14 matching lines...) Expand all Loading... |
95 Operand ToOperand(LOperand* op) const; | 96 Operand ToOperand(LOperand* op) const; |
96 Register ToRegister(LOperand* op) const; | 97 Register ToRegister(LOperand* op) const; |
97 XMMRegister ToDoubleRegister(LOperand* op) const; | 98 XMMRegister ToDoubleRegister(LOperand* op) const; |
98 bool IsX87TopOfStack(LOperand* op) const; | 99 bool IsX87TopOfStack(LOperand* op) const; |
99 | 100 |
100 bool IsInteger32(LConstantOperand* op) const; | 101 bool IsInteger32(LConstantOperand* op) const; |
101 Immediate ToInteger32Immediate(LOperand* op) const { | 102 Immediate ToInteger32Immediate(LOperand* op) const { |
102 return Immediate(ToInteger32(LConstantOperand::cast(op))); | 103 return Immediate(ToInteger32(LConstantOperand::cast(op))); |
103 } | 104 } |
104 | 105 |
| 106 // Support for non-sse2 (x87) floating point stack handling. |
| 107 // These functions maintain the depth of the stack (either 0 or 1) |
| 108 void PushX87DoubleOperand(Operand src); |
| 109 void PushX87FloatOperand(Operand src); |
| 110 void ReadX87Operand(Operand dst); |
| 111 bool X87StackNonEmpty() const { return x87_stack_depth_ > 0; } |
| 112 void PopX87(); |
| 113 void CurrentInstructionReturnsX87Result(); |
| 114 |
105 Handle<Object> ToHandle(LConstantOperand* op) const; | 115 Handle<Object> ToHandle(LConstantOperand* op) const; |
106 | 116 |
107 // A utility for instructions that return floating point values on X87. | |
108 void HandleX87FPReturnValue(LInstruction* instr); | |
109 | |
110 // The operand denoting the second word (the one with a higher address) of | 117 // The operand denoting the second word (the one with a higher address) of |
111 // a double stack slot. | 118 // a double stack slot. |
112 Operand HighOperand(LOperand* op); | 119 Operand HighOperand(LOperand* op); |
113 | 120 |
114 // Try to generate code for the entire chunk, but it may fail if the | 121 // Try to generate code for the entire chunk, but it may fail if the |
115 // chunk contains constructs we cannot handle. Returns true if the | 122 // chunk contains constructs we cannot handle. Returns true if the |
116 // code generation attempt succeeded. | 123 // code generation attempt succeeded. |
117 bool GenerateCode(); | 124 bool GenerateCode(); |
118 | 125 |
119 // Finish the code by setting stack height, safepoint, and bailout | 126 // Finish the code by setting stack height, safepoint, and bailout |
120 // information on it. | 127 // information on it. |
121 void FinishCode(Handle<Code> code); | 128 void FinishCode(Handle<Code> code); |
122 | 129 |
123 // Deferred code support. | 130 // Deferred code support. |
124 void DoDeferredNumberTagD(LNumberTagD* instr); | 131 void DoDeferredNumberTagD(LNumberTagD* instr); |
125 | 132 |
126 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; | 133 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; |
127 void DoDeferredNumberTagI(LInstruction* instr, | 134 void DoDeferredNumberTagI(LInstruction* instr, |
128 LOperand* value, | 135 LOperand* value, |
129 IntegerSignedness signedness); | 136 IntegerSignedness signedness); |
130 | 137 |
131 void DoDeferredTaggedToI(LTaggedToI* instr); | 138 void DoDeferredTaggedToI(LTaggedToI* instr); |
| 139 void DoDeferredTaggedToINoSSE2(LTaggedToINoSSE2* instr); |
132 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); | 140 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); |
133 void DoDeferredStackCheck(LStackCheck* instr); | 141 void DoDeferredStackCheck(LStackCheck* instr); |
134 void DoDeferredRandom(LRandom* instr); | 142 void DoDeferredRandom(LRandom* instr); |
135 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); | 143 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); |
136 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); | 144 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); |
137 void DoDeferredAllocateObject(LAllocateObject* instr); | 145 void DoDeferredAllocateObject(LAllocateObject* instr); |
138 void DoDeferredAllocate(LAllocate* instr); | 146 void DoDeferredAllocate(LAllocate* instr); |
139 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, | 147 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
140 Label* map_check); | 148 Label* map_check); |
141 | 149 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 void EmitBranch(int left_block, int right_block, Condition cc); | 316 void EmitBranch(int left_block, int right_block, Condition cc); |
309 void EmitNumberUntagD( | 317 void EmitNumberUntagD( |
310 Register input, | 318 Register input, |
311 Register temp, | 319 Register temp, |
312 XMMRegister result, | 320 XMMRegister result, |
313 bool deoptimize_on_undefined, | 321 bool deoptimize_on_undefined, |
314 bool deoptimize_on_minus_zero, | 322 bool deoptimize_on_minus_zero, |
315 LEnvironment* env, | 323 LEnvironment* env, |
316 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); | 324 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); |
317 | 325 |
| 326 void EmitNumberUntagDNoSSE2( |
| 327 Register input, |
| 328 Register temp, |
| 329 bool deoptimize_on_undefined, |
| 330 bool deoptimize_on_minus_zero, |
| 331 LEnvironment* env, |
| 332 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); |
| 333 |
318 // Emits optimized code for typeof x == "y". Modifies input register. | 334 // Emits optimized code for typeof x == "y". Modifies input register. |
319 // Returns the condition on which a final split to | 335 // Returns the condition on which a final split to |
320 // true and false label should be made, to optimize fallthrough. | 336 // true and false label should be made, to optimize fallthrough. |
321 Condition EmitTypeofIs(Label* true_label, | 337 Condition EmitTypeofIs(Label* true_label, |
322 Label* false_label, | 338 Label* false_label, |
323 Register input, | 339 Register input, |
324 Handle<String> type_name); | 340 Handle<String> type_name); |
325 | 341 |
326 // Emits optimized code for %_IsObject(x). Preserves input register. | 342 // Emits optimized code for %_IsObject(x). Preserves input register. |
327 // Returns the condition on which a final split to | 343 // Returns the condition on which a final split to |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 int inlined_function_count_; | 413 int inlined_function_count_; |
398 Scope* const scope_; | 414 Scope* const scope_; |
399 Status status_; | 415 Status status_; |
400 TranslationBuffer translations_; | 416 TranslationBuffer translations_; |
401 ZoneList<LDeferredCode*> deferred_; | 417 ZoneList<LDeferredCode*> deferred_; |
402 bool dynamic_frame_alignment_; | 418 bool dynamic_frame_alignment_; |
403 bool support_aligned_spilled_doubles_; | 419 bool support_aligned_spilled_doubles_; |
404 int osr_pc_offset_; | 420 int osr_pc_offset_; |
405 int last_lazy_deopt_pc_; | 421 int last_lazy_deopt_pc_; |
406 bool frame_is_built_; | 422 bool frame_is_built_; |
| 423 int x87_stack_depth_; |
407 | 424 |
408 // Builder that keeps track of safepoints in the code. The table | 425 // Builder that keeps track of safepoints in the code. The table |
409 // itself is emitted at the end of the generated code. | 426 // itself is emitted at the end of the generated code. |
410 SafepointTableBuilder safepoints_; | 427 SafepointTableBuilder safepoints_; |
411 | 428 |
412 // Compiler from a set of parallel moves to a sequential list of moves. | 429 // Compiler from a set of parallel moves to a sequential list of moves. |
413 LGapResolver resolver_; | 430 LGapResolver resolver_; |
414 | 431 |
415 Safepoint::Kind expected_safepoint_kind_; | 432 Safepoint::Kind expected_safepoint_kind_; |
416 | 433 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 LCodeGen* codegen_; | 484 LCodeGen* codegen_; |
468 Label entry_; | 485 Label entry_; |
469 Label exit_; | 486 Label exit_; |
470 Label* external_exit_; | 487 Label* external_exit_; |
471 int instruction_index_; | 488 int instruction_index_; |
472 }; | 489 }; |
473 | 490 |
474 } } // namespace v8::internal | 491 } } // namespace v8::internal |
475 | 492 |
476 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ | 493 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ |
OLD | NEW |