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

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

Issue 6263005: Change the algorithm and generated code for parallel moves on IA32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build/ia32
Patch Set: Rebased to HEAD. Created 9 years, 11 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 16 matching lines...) Expand all
27 27
28 #ifndef V8_IA32_LITHIUM_CODEGEN_IA32_H_ 28 #ifndef V8_IA32_LITHIUM_CODEGEN_IA32_H_
29 #define V8_IA32_LITHIUM_CODEGEN_IA32_H_ 29 #define V8_IA32_LITHIUM_CODEGEN_IA32_H_
30 30
31 #include "ia32/lithium-ia32.h" 31 #include "ia32/lithium-ia32.h"
32 32
33 #include "checks.h" 33 #include "checks.h"
34 #include "deoptimizer.h" 34 #include "deoptimizer.h"
35 #include "safepoint-table.h" 35 #include "safepoint-table.h"
36 #include "scopes.h" 36 #include "scopes.h"
37 #include "ia32/lithium-gap-resolver-ia32.h"
37 38
38 namespace v8 { 39 namespace v8 {
39 namespace internal { 40 namespace internal {
40 41
41 // Forward declarations. 42 // Forward declarations.
42 class LDeferredCode; 43 class LDeferredCode;
43 class LGapNode; 44 class LGapNode;
44 class SafepointGenerator; 45 class SafepointGenerator;
45 46
46 class LGapResolver BASE_EMBEDDED { 47 class LGapResolver BASE_EMBEDDED {
(...skipping 26 matching lines...) Expand all
73 info_(info), 74 info_(info),
74 current_block_(-1), 75 current_block_(-1),
75 current_instruction_(-1), 76 current_instruction_(-1),
76 instructions_(chunk->instructions()), 77 instructions_(chunk->instructions()),
77 deoptimizations_(4), 78 deoptimizations_(4),
78 deoptimization_literals_(8), 79 deoptimization_literals_(8),
79 inlined_function_count_(0), 80 inlined_function_count_(0),
80 scope_(chunk->graph()->info()->scope()), 81 scope_(chunk->graph()->info()->scope()),
81 status_(UNUSED), 82 status_(UNUSED),
82 deferred_(8), 83 deferred_(8),
83 osr_pc_offset_(-1) { 84 osr_pc_offset_(-1),
85 resolver_(this) {
84 PopulateDeoptimizationLiteralsWithInlinedFunctions(); 86 PopulateDeoptimizationLiteralsWithInlinedFunctions();
85 } 87 }
86 88
89 // Simple accessors.
90 MacroAssembler* masm() const { return masm_; }
91
92 // Support for converting LOperands to assembler types.
93 Operand ToOperand(LOperand* op) const;
94 Register ToRegister(LOperand* op) const;
95 XMMRegister ToDoubleRegister(LOperand* op) const;
96 Immediate ToImmediate(LOperand* op);
97
87 // Try to generate code for the entire chunk, but it may fail if the 98 // Try to generate code for the entire chunk, but it may fail if the
88 // chunk contains constructs we cannot handle. Returns true if the 99 // chunk contains constructs we cannot handle. Returns true if the
89 // code generation attempt succeeded. 100 // code generation attempt succeeded.
90 bool GenerateCode(); 101 bool GenerateCode();
91 102
92 // Finish the code by setting stack height, safepoint, and bailout 103 // Finish the code by setting stack height, safepoint, and bailout
93 // information on it. 104 // information on it.
94 void FinishCode(Handle<Code> code); 105 void FinishCode(Handle<Code> code);
95 106
96 // Deferred code support. 107 // Deferred code support.
(...skipping 25 matching lines...) Expand all
122 }; 133 };
123 134
124 bool is_unused() const { return status_ == UNUSED; } 135 bool is_unused() const { return status_ == UNUSED; }
125 bool is_generating() const { return status_ == GENERATING; } 136 bool is_generating() const { return status_ == GENERATING; }
126 bool is_done() const { return status_ == DONE; } 137 bool is_done() const { return status_ == DONE; }
127 bool is_aborted() const { return status_ == ABORTED; } 138 bool is_aborted() const { return status_ == ABORTED; }
128 139
129 LChunk* chunk() const { return chunk_; } 140 LChunk* chunk() const { return chunk_; }
130 Scope* scope() const { return scope_; } 141 Scope* scope() const { return scope_; }
131 HGraph* graph() const { return chunk_->graph(); } 142 HGraph* graph() const { return chunk_->graph(); }
132 MacroAssembler* masm() const { return masm_; }
133 143
134 int GetNextEmittedBlock(int block); 144 int GetNextEmittedBlock(int block);
135 LInstruction* GetNextInstruction(); 145 LInstruction* GetNextInstruction();
136 146
137 void EmitClassOfTest(Label* if_true, 147 void EmitClassOfTest(Label* if_true,
138 Label* if_false, 148 Label* if_false,
139 Handle<String> class_name, 149 Handle<String> class_name,
140 Register input, 150 Register input,
141 Register temporary, 151 Register temporary,
142 Register temporary2); 152 Register temporary2);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 void AddToTranslation(Translation* translation, 194 void AddToTranslation(Translation* translation,
185 LOperand* op, 195 LOperand* op,
186 bool is_tagged); 196 bool is_tagged);
187 void PopulateDeoptimizationData(Handle<Code> code); 197 void PopulateDeoptimizationData(Handle<Code> code);
188 int DefineDeoptimizationLiteral(Handle<Object> literal); 198 int DefineDeoptimizationLiteral(Handle<Object> literal);
189 199
190 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); 200 void PopulateDeoptimizationLiteralsWithInlinedFunctions();
191 201
192 Register ToRegister(int index) const; 202 Register ToRegister(int index) const;
193 XMMRegister ToDoubleRegister(int index) const; 203 XMMRegister ToDoubleRegister(int index) const;
194 Register ToRegister(LOperand* op) const;
195 XMMRegister ToDoubleRegister(LOperand* op) const;
196 int ToInteger32(LConstantOperand* op) const; 204 int ToInteger32(LConstantOperand* op) const;
197 Operand ToOperand(LOperand* op) const;
198 Immediate ToImmediate(LOperand* op);
199 205
200 // Specific math operations - used from DoUnaryMathOperation. 206 // Specific math operations - used from DoUnaryMathOperation.
201 void DoMathAbs(LUnaryMathOperation* instr); 207 void DoMathAbs(LUnaryMathOperation* instr);
202 void DoMathFloor(LUnaryMathOperation* instr); 208 void DoMathFloor(LUnaryMathOperation* instr);
203 void DoMathRound(LUnaryMathOperation* instr); 209 void DoMathRound(LUnaryMathOperation* instr);
204 void DoMathSqrt(LUnaryMathOperation* instr); 210 void DoMathSqrt(LUnaryMathOperation* instr);
205 void DoMathPowHalf(LUnaryMathOperation* instr); 211 void DoMathPowHalf(LUnaryMathOperation* instr);
206 void DoMathLog(LUnaryMathOperation* instr); 212 void DoMathLog(LUnaryMathOperation* instr);
207 void DoMathCos(LUnaryMathOperation* instr); 213 void DoMathCos(LUnaryMathOperation* instr);
208 void DoMathSin(LUnaryMathOperation* instr); 214 void DoMathSin(LUnaryMathOperation* instr);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 private: 292 private:
287 LCodeGen* codegen_; 293 LCodeGen* codegen_;
288 Label entry_; 294 Label entry_;
289 Label exit_; 295 Label exit_;
290 Label* external_exit_; 296 Label* external_exit_;
291 }; 297 };
292 298
293 } } // namespace v8::internal 299 } } // namespace v8::internal
294 300
295 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ 301 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698