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

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

Issue 6815010: Merge r7516, r7541 into 3.1 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.1/
Patch Set: Created 9 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/frames-inl.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 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 current_instruction_(-1), 54 current_instruction_(-1),
55 instructions_(chunk->instructions()), 55 instructions_(chunk->instructions()),
56 deoptimizations_(4), 56 deoptimizations_(4),
57 deoptimization_literals_(8), 57 deoptimization_literals_(8),
58 inlined_function_count_(0), 58 inlined_function_count_(0),
59 scope_(chunk->graph()->info()->scope()), 59 scope_(chunk->graph()->info()->scope()),
60 status_(UNUSED), 60 status_(UNUSED),
61 deferred_(8), 61 deferred_(8),
62 osr_pc_offset_(-1), 62 osr_pc_offset_(-1),
63 deoptimization_reloc_size(), 63 deoptimization_reloc_size(),
64 resolver_(this) { 64 resolver_(this),
65 expected_safepoint_kind_(Safepoint::kSimple) {
65 PopulateDeoptimizationLiteralsWithInlinedFunctions(); 66 PopulateDeoptimizationLiteralsWithInlinedFunctions();
66 } 67 }
67 68
68 // Simple accessors. 69 // Simple accessors.
69 MacroAssembler* masm() const { return masm_; } 70 MacroAssembler* masm() const { return masm_; }
70 71
71 // Support for converting LOperands to assembler types. 72 // Support for converting LOperands to assembler types.
72 Operand ToOperand(LOperand* op) const; 73 Operand ToOperand(LOperand* op) const;
73 Register ToRegister(LOperand* op) const; 74 Register ToRegister(LOperand* op) const;
74 XMMRegister ToDoubleRegister(LOperand* op) const; 75 XMMRegister ToDoubleRegister(LOperand* op) const;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Code generation passes. Returns true if code generation should 153 // Code generation passes. Returns true if code generation should
153 // continue. 154 // continue.
154 bool GeneratePrologue(); 155 bool GeneratePrologue();
155 bool GenerateBody(); 156 bool GenerateBody();
156 bool GenerateDeferredCode(); 157 bool GenerateDeferredCode();
157 // Pad the reloc info to ensure that we have enough space to patch during 158 // Pad the reloc info to ensure that we have enough space to patch during
158 // deoptimization. 159 // deoptimization.
159 bool GenerateRelocPadding(); 160 bool GenerateRelocPadding();
160 bool GenerateSafepointTable(); 161 bool GenerateSafepointTable();
161 162
162 void CallCode(Handle<Code> code, RelocInfo::Mode mode, LInstruction* instr, 163 enum ContextMode {
163 bool adjusted = true); 164 RESTORE_CONTEXT,
164 void CallRuntime(Runtime::Function* fun, int argc, LInstruction* instr, 165 CONTEXT_ADJUSTED
165 bool adjusted = true); 166 };
166 void CallRuntime(Runtime::FunctionId id, int argc, LInstruction* instr, 167
167 bool adjusted = true) { 168 enum SafepointMode {
169 RECORD_SIMPLE_SAFEPOINT,
170 RECORD_SAFEPOINT_WITH_REGISTERS_AND_NO_ARGUMENTS
171 };
172
173 void CallCode(Handle<Code> code,
174 RelocInfo::Mode mode,
175 LInstruction* instr,
176 ContextMode context_mode);
177
178 void CallCodeGeneric(Handle<Code> code,
179 RelocInfo::Mode mode,
180 LInstruction* instr,
181 ContextMode context_mode,
182 SafepointMode safepoint_mode);
183
184 void CallRuntime(Runtime::Function* fun,
185 int argc,
186 LInstruction* instr,
187 ContextMode context_mode);
188
189 void CallRuntime(Runtime::FunctionId id,
190 int argc,
191 LInstruction* instr,
192 ContextMode context_mode) {
168 Runtime::Function* function = Runtime::FunctionForId(id); 193 Runtime::Function* function = Runtime::FunctionForId(id);
169 CallRuntime(function, argc, instr, adjusted); 194 CallRuntime(function, argc, instr, context_mode);
170 } 195 }
171 196
197 void CallRuntimeFromDeferred(Runtime::FunctionId id,
198 int argc,
199 LInstruction* instr);
200
172 // Generate a direct call to a known function. Expects the function 201 // Generate a direct call to a known function. Expects the function
173 // to be in edi. 202 // to be in edi.
174 void CallKnownFunction(Handle<JSFunction> function, 203 void CallKnownFunction(Handle<JSFunction> function,
175 int arity, 204 int arity,
176 LInstruction* instr); 205 LInstruction* instr);
177 206
178 void LoadHeapObject(Register result, Handle<HeapObject> object); 207 void LoadHeapObject(Register result, Handle<HeapObject> object);
179 208
180 void RegisterLazyDeoptimization(LInstruction* instr); 209 void RegisterLazyDeoptimization(LInstruction* instr,
210 SafepointMode safepoint_mode);
211
181 void RegisterEnvironmentForDeoptimization(LEnvironment* environment); 212 void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
182 void DeoptimizeIf(Condition cc, LEnvironment* environment); 213 void DeoptimizeIf(Condition cc, LEnvironment* environment);
183 214
184 void AddToTranslation(Translation* translation, 215 void AddToTranslation(Translation* translation,
185 LOperand* op, 216 LOperand* op,
186 bool is_tagged); 217 bool is_tagged);
187 void PopulateDeoptimizationData(Handle<Code> code); 218 void PopulateDeoptimizationData(Handle<Code> code);
188 int DefineDeoptimizationLiteral(Handle<Object> literal); 219 int DefineDeoptimizationLiteral(Handle<Object> literal);
189 220
190 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); 221 void PopulateDeoptimizationLiteralsWithInlinedFunctions();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 296
266 DeoptimizationRelocSize deoptimization_reloc_size; 297 DeoptimizationRelocSize deoptimization_reloc_size;
267 298
268 // Builder that keeps track of safepoints in the code. The table 299 // Builder that keeps track of safepoints in the code. The table
269 // itself is emitted at the end of the generated code. 300 // itself is emitted at the end of the generated code.
270 SafepointTableBuilder safepoints_; 301 SafepointTableBuilder safepoints_;
271 302
272 // Compiler from a set of parallel moves to a sequential list of moves. 303 // Compiler from a set of parallel moves to a sequential list of moves.
273 LGapResolver resolver_; 304 LGapResolver resolver_;
274 305
306 Safepoint::Kind expected_safepoint_kind_;
307
308 class PushSafepointRegistersScope BASE_EMBEDDED {
309 public:
310 explicit PushSafepointRegistersScope(LCodeGen* codegen)
311 : codegen_(codegen) {
312 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple);
313 codegen_->masm_->PushSafepointRegisters();
314 codegen_->expected_safepoint_kind_ = Safepoint::kWithRegisters;
315 }
316
317 ~PushSafepointRegistersScope() {
318 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kWithRegisters);
319 codegen_->masm_->PopSafepointRegisters();
320 codegen_->expected_safepoint_kind_ = Safepoint::kSimple;
321 }
322
323 private:
324 LCodeGen* codegen_;
325 };
326
275 friend class LDeferredCode; 327 friend class LDeferredCode;
276 friend class LEnvironment; 328 friend class LEnvironment;
277 friend class SafepointGenerator; 329 friend class SafepointGenerator;
278 DISALLOW_COPY_AND_ASSIGN(LCodeGen); 330 DISALLOW_COPY_AND_ASSIGN(LCodeGen);
279 }; 331 };
280 332
281 333
282 class LDeferredCode: public ZoneObject { 334 class LDeferredCode: public ZoneObject {
283 public: 335 public:
284 explicit LDeferredCode(LCodeGen* codegen) 336 explicit LDeferredCode(LCodeGen* codegen)
(...skipping 15 matching lines...) Expand all
300 private: 352 private:
301 LCodeGen* codegen_; 353 LCodeGen* codegen_;
302 Label entry_; 354 Label entry_;
303 Label exit_; 355 Label exit_;
304 Label* external_exit_; 356 Label* external_exit_;
305 }; 357 };
306 358
307 } } // namespace v8::internal 359 } } // namespace v8::internal
308 360
309 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ 361 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_
OLDNEW
« no previous file with comments | « src/frames-inl.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698