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

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: Improvements 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
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 PushX87Operand(Operand src);
109 void PushX87FloatOperand(Operand src);
110 void ReadX87Operand(Operand dst);
111 void PopX87();
112 void MarkReturnX87Result();
113
105 Handle<Object> ToHandle(LConstantOperand* op) const; 114 Handle<Object> ToHandle(LConstantOperand* op) const;
106 115
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 116 // The operand denoting the second word (the one with a higher address) of
111 // a double stack slot. 117 // a double stack slot.
112 Operand HighOperand(LOperand* op); 118 Operand HighOperand(LOperand* op);
113 119
114 // Try to generate code for the entire chunk, but it may fail if the 120 // 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 121 // chunk contains constructs we cannot handle. Returns true if the
116 // code generation attempt succeeded. 122 // code generation attempt succeeded.
117 bool GenerateCode(); 123 bool GenerateCode();
118 124
119 // Finish the code by setting stack height, safepoint, and bailout 125 // Finish the code by setting stack height, safepoint, and bailout
120 // information on it. 126 // information on it.
121 void FinishCode(Handle<Code> code); 127 void FinishCode(Handle<Code> code);
122 128
123 // Deferred code support. 129 // Deferred code support.
124 void DoDeferredNumberTagD(LNumberTagD* instr); 130 void DoDeferredNumberTagD(LNumberTagD* instr);
125 131
126 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 }; 132 enum IntegerSignedness { SIGNED_INT32, UNSIGNED_INT32 };
127 void DoDeferredNumberTagI(LInstruction* instr, 133 void DoDeferredNumberTagI(LInstruction* instr,
128 LOperand* value, 134 LOperand* value,
129 IntegerSignedness signedness); 135 IntegerSignedness signedness);
130 136
131 void DoDeferredTaggedToI(LTaggedToI* instr); 137 void DoDeferredTaggedToI(LTaggedToI* instr);
138 void DoDeferredTaggedToINoSSE2(LTaggedToINoSSE2* instr);
132 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); 139 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
133 void DoDeferredStackCheck(LStackCheck* instr); 140 void DoDeferredStackCheck(LStackCheck* instr);
134 void DoDeferredRandom(LRandom* instr); 141 void DoDeferredRandom(LRandom* instr);
135 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); 142 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
136 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); 143 void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
137 void DoDeferredAllocateObject(LAllocateObject* instr); 144 void DoDeferredAllocateObject(LAllocateObject* instr);
138 void DoDeferredAllocate(LAllocate* instr); 145 void DoDeferredAllocate(LAllocate* instr);
139 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, 146 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
140 Label* map_check); 147 Label* map_check);
141 148
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 void EmitBranch(int left_block, int right_block, Condition cc); 315 void EmitBranch(int left_block, int right_block, Condition cc);
309 void EmitNumberUntagD( 316 void EmitNumberUntagD(
310 Register input, 317 Register input,
311 Register temp, 318 Register temp,
312 XMMRegister result, 319 XMMRegister result,
313 bool deoptimize_on_undefined, 320 bool deoptimize_on_undefined,
314 bool deoptimize_on_minus_zero, 321 bool deoptimize_on_minus_zero,
315 LEnvironment* env, 322 LEnvironment* env,
316 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); 323 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED);
317 324
325 void EmitNumberUntagDNoSSE2(
326 Register input,
327 Register temp,
328 bool deoptimize_on_undefined,
329 bool deoptimize_on_minus_zero,
330 LEnvironment* env,
331 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED);
332
318 // Emits optimized code for typeof x == "y". Modifies input register. 333 // Emits optimized code for typeof x == "y". Modifies input register.
319 // Returns the condition on which a final split to 334 // Returns the condition on which a final split to
320 // true and false label should be made, to optimize fallthrough. 335 // true and false label should be made, to optimize fallthrough.
321 Condition EmitTypeofIs(Label* true_label, 336 Condition EmitTypeofIs(Label* true_label,
322 Label* false_label, 337 Label* false_label,
323 Register input, 338 Register input,
324 Handle<String> type_name); 339 Handle<String> type_name);
325 340
326 // Emits optimized code for %_IsObject(x). Preserves input register. 341 // Emits optimized code for %_IsObject(x). Preserves input register.
327 // Returns the condition on which a final split to 342 // 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_; 412 int inlined_function_count_;
398 Scope* const scope_; 413 Scope* const scope_;
399 Status status_; 414 Status status_;
400 TranslationBuffer translations_; 415 TranslationBuffer translations_;
401 ZoneList<LDeferredCode*> deferred_; 416 ZoneList<LDeferredCode*> deferred_;
402 bool dynamic_frame_alignment_; 417 bool dynamic_frame_alignment_;
403 bool support_aligned_spilled_doubles_; 418 bool support_aligned_spilled_doubles_;
404 int osr_pc_offset_; 419 int osr_pc_offset_;
405 int last_lazy_deopt_pc_; 420 int last_lazy_deopt_pc_;
406 bool frame_is_built_; 421 bool frame_is_built_;
422 int x87_stack_depth_;
407 423
408 // Builder that keeps track of safepoints in the code. The table 424 // Builder that keeps track of safepoints in the code. The table
409 // itself is emitted at the end of the generated code. 425 // itself is emitted at the end of the generated code.
410 SafepointTableBuilder safepoints_; 426 SafepointTableBuilder safepoints_;
411 427
412 // Compiler from a set of parallel moves to a sequential list of moves. 428 // Compiler from a set of parallel moves to a sequential list of moves.
413 LGapResolver resolver_; 429 LGapResolver resolver_;
414 430
415 Safepoint::Kind expected_safepoint_kind_; 431 Safepoint::Kind expected_safepoint_kind_;
416 432
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 LCodeGen* codegen_; 483 LCodeGen* codegen_;
468 Label entry_; 484 Label entry_;
469 Label exit_; 485 Label exit_;
470 Label* external_exit_; 486 Label* external_exit_;
471 int instruction_index_; 487 int instruction_index_;
472 }; 488 };
473 489
474 } } // namespace v8::internal 490 } } // namespace v8::internal
475 491
476 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ 492 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698