Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(760)

Side by Side Diff: src/ia32/lithium-codegen-ia32.h

Issue 13426006: Improvements for x87 stack handling (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Last comments Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 void FlushX87StackIfNecessary(LInstruction* instr);
115
105 Handle<Object> ToHandle(LConstantOperand* op) const; 116 Handle<Object> ToHandle(LConstantOperand* op) const;
106 117
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 118 // The operand denoting the second word (the one with a higher address) of
111 // a double stack slot. 119 // a double stack slot.
112 Operand HighOperand(LOperand* op); 120 Operand HighOperand(LOperand* op);
113 121
114 // Try to generate code for the entire chunk, but it may fail if the 122 // 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 123 // chunk contains constructs we cannot handle. Returns true if the
116 // code generation attempt succeeded. 124 // code generation attempt succeeded.
117 bool GenerateCode(); 125 bool GenerateCode();
118 126
119 // Finish the code by setting stack height, safepoint, and bailout 127 // Finish the code by setting stack height, safepoint, and bailout
120 // information on it. 128 // information on it.
121 void FinishCode(Handle<Code> code); 129 void FinishCode(Handle<Code> code);
122 130
123 // Deferred code support. 131 // Deferred code support.
124 void DoDeferredNumberTagD(LNumberTagD* instr); 132 void DoDeferredNumberTagD(LNumberTagD* instr);
125 133
126 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; 134 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 };
127 void DoDeferredNumberTagI(LInstruction* instr, 135 void DoDeferredNumberTagI(LInstruction* instr,
128 LOperand* value, 136 LOperand* value,
129 IntegerSignedness signedness); 137 IntegerSignedness signedness);
130 138
131 void DoDeferredTaggedToI(LTaggedToI* instr); 139 void DoDeferredTaggedToI(LTaggedToI* instr);
140 void DoDeferredTaggedToINoSSE2(LTaggedToINoSSE2* instr);
132 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); 141 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
133 void DoDeferredStackCheck(LStackCheck* instr); 142 void DoDeferredStackCheck(LStackCheck* instr);
134 void DoDeferredRandom(LRandom* instr); 143 void DoDeferredRandom(LRandom* instr);
135 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); 144 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
136 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); 145 void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
137 void DoDeferredAllocateObject(LAllocateObject* instr); 146 void DoDeferredAllocateObject(LAllocateObject* instr);
138 void DoDeferredAllocate(LAllocate* instr); 147 void DoDeferredAllocate(LAllocate* instr);
139 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, 148 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
140 Label* map_check); 149 Label* map_check);
141 150
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 void EmitBranch(int left_block, int right_block, Condition cc); 317 void EmitBranch(int left_block, int right_block, Condition cc);
309 void EmitNumberUntagD( 318 void EmitNumberUntagD(
310 Register input, 319 Register input,
311 Register temp, 320 Register temp,
312 XMMRegister result, 321 XMMRegister result,
313 bool deoptimize_on_undefined, 322 bool deoptimize_on_undefined,
314 bool deoptimize_on_minus_zero, 323 bool deoptimize_on_minus_zero,
315 LEnvironment* env, 324 LEnvironment* env,
316 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); 325 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED);
317 326
327 void EmitNumberUntagDNoSSE2(
328 Register input,
329 Register temp,
330 bool deoptimize_on_undefined,
331 bool deoptimize_on_minus_zero,
332 LEnvironment* env,
333 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED);
334
318 // Emits optimized code for typeof x == "y". Modifies input register. 335 // Emits optimized code for typeof x == "y". Modifies input register.
319 // Returns the condition on which a final split to 336 // Returns the condition on which a final split to
320 // true and false label should be made, to optimize fallthrough. 337 // true and false label should be made, to optimize fallthrough.
321 Condition EmitTypeofIs(Label* true_label, 338 Condition EmitTypeofIs(Label* true_label,
322 Label* false_label, 339 Label* false_label,
323 Register input, 340 Register input,
324 Handle<String> type_name); 341 Handle<String> type_name);
325 342
326 // Emits optimized code for %_IsObject(x). Preserves input register. 343 // Emits optimized code for %_IsObject(x). Preserves input register.
327 // Returns the condition on which a final split to 344 // Returns the condition on which a final split to
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 int inlined_function_count_; 414 int inlined_function_count_;
398 Scope* const scope_; 415 Scope* const scope_;
399 Status status_; 416 Status status_;
400 TranslationBuffer translations_; 417 TranslationBuffer translations_;
401 ZoneList<LDeferredCode*> deferred_; 418 ZoneList<LDeferredCode*> deferred_;
402 bool dynamic_frame_alignment_; 419 bool dynamic_frame_alignment_;
403 bool support_aligned_spilled_doubles_; 420 bool support_aligned_spilled_doubles_;
404 int osr_pc_offset_; 421 int osr_pc_offset_;
405 int last_lazy_deopt_pc_; 422 int last_lazy_deopt_pc_;
406 bool frame_is_built_; 423 bool frame_is_built_;
424 int x87_stack_depth_;
407 425
408 // Builder that keeps track of safepoints in the code. The table 426 // Builder that keeps track of safepoints in the code. The table
409 // itself is emitted at the end of the generated code. 427 // itself is emitted at the end of the generated code.
410 SafepointTableBuilder safepoints_; 428 SafepointTableBuilder safepoints_;
411 429
412 // Compiler from a set of parallel moves to a sequential list of moves. 430 // Compiler from a set of parallel moves to a sequential list of moves.
413 LGapResolver resolver_; 431 LGapResolver resolver_;
414 432
415 Safepoint::Kind expected_safepoint_kind_; 433 Safepoint::Kind expected_safepoint_kind_;
416 434
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 LCodeGen* codegen_; 485 LCodeGen* codegen_;
468 Label entry_; 486 Label entry_;
469 Label exit_; 487 Label exit_;
470 Label* external_exit_; 488 Label* external_exit_;
471 int instruction_index_; 489 int instruction_index_;
472 }; 490 };
473 491
474 } } // namespace v8::internal 492 } } // namespace v8::internal
475 493
476 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ 494 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698