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

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

Issue 148153010: Synchronize with r15701. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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/ia32/deoptimizer-ia32.cc ('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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 info()->requires_frame(); 98 info()->requires_frame();
99 } 99 }
100 bool NeedsDeferredFrame() const { 100 bool NeedsDeferredFrame() const {
101 return !NeedsEagerFrame() && info()->is_deferred_calling(); 101 return !NeedsEagerFrame() && info()->is_deferred_calling();
102 } 102 }
103 103
104 // Support for converting LOperands to assembler types. 104 // Support for converting LOperands to assembler types.
105 Operand ToOperand(LOperand* op) const; 105 Operand ToOperand(LOperand* op) const;
106 Register ToRegister(LOperand* op) const; 106 Register ToRegister(LOperand* op) const;
107 XMMRegister ToDoubleRegister(LOperand* op) const; 107 XMMRegister ToDoubleRegister(LOperand* op) const;
108 bool IsX87TopOfStack(LOperand* op) const; 108 X87Register ToX87Register(LOperand* op) const;
109 109
110 bool IsInteger32(LConstantOperand* op) const; 110 bool IsInteger32(LConstantOperand* op) const;
111 bool IsSmi(LConstantOperand* op) const; 111 bool IsSmi(LConstantOperand* op) const;
112 Immediate ToInteger32Immediate(LOperand* op) const { 112 Immediate ToInteger32Immediate(LOperand* op) const {
113 return Immediate(ToInteger32(LConstantOperand::cast(op))); 113 return Immediate(ToInteger32(LConstantOperand::cast(op)));
114 } 114 }
115 Immediate ToSmiImmediate(LOperand* op) const { 115 Immediate ToSmiImmediate(LOperand* op) const {
116 return Immediate(Smi::FromInt(ToInteger32(LConstantOperand::cast(op)))); 116 return Immediate(Smi::FromInt(ToInteger32(LConstantOperand::cast(op))));
117 } 117 }
118 double ToDouble(LConstantOperand* op) const; 118 double ToDouble(LConstantOperand* op) const;
119 119
120 // Support for non-sse2 (x87) floating point stack handling. 120 // Support for non-sse2 (x87) floating point stack handling.
121 // These functions maintain the depth of the stack (either 0 or 1) 121 // These functions maintain the mapping of physical stack registers to our
122 void PushX87DoubleOperand(Operand src); 122 // virtual registers between instructions.
123 void PushX87FloatOperand(Operand src); 123 enum X87OperandType { kX87DoubleOperand, kX87FloatOperand, kX87IntOperand };
124 void ReadX87Operand(Operand dst); 124
125 bool X87StackNonEmpty() const { return x87_stack_depth_ > 0; } 125 void X87Mov(X87Register reg, Operand src,
126 void PopX87(); 126 X87OperandType operand = kX87DoubleOperand);
127 void CurrentInstructionReturnsX87Result(); 127 void X87Mov(Operand src, X87Register reg);
128 void FlushX87StackIfNecessary(LInstruction* instr); 128
129 void X87PrepareBinaryOp(
130 X87Register left, X87Register right, X87Register result);
131
132 void X87LoadForUsage(X87Register reg);
133 void X87PrepareToWrite(X87Register reg);
134 void X87CommitWrite(X87Register reg);
129 135
130 Handle<Object> ToHandle(LConstantOperand* op) const; 136 Handle<Object> ToHandle(LConstantOperand* op) const;
131 137
132 // The operand denoting the second word (the one with a higher address) of 138 // The operand denoting the second word (the one with a higher address) of
133 // a double stack slot. 139 // a double stack slot.
134 Operand HighOperand(LOperand* op); 140 Operand HighOperand(LOperand* op);
135 141
136 // Try to generate code for the entire chunk, but it may fail if the 142 // Try to generate code for the entire chunk, but it may fail if the
137 // chunk contains constructs we cannot handle. Returns true if the 143 // chunk contains constructs we cannot handle. Returns true if the
138 // code generation attempt succeeded. 144 // code generation attempt succeeded.
(...skipping 11 matching lines...) Expand all
150 LOperand* value, 156 LOperand* value,
151 IntegerSignedness signedness); 157 IntegerSignedness signedness);
152 158
153 void DoDeferredTaggedToI(LTaggedToI* instr); 159 void DoDeferredTaggedToI(LTaggedToI* instr);
154 void DoDeferredTaggedToINoSSE2(LTaggedToINoSSE2* instr); 160 void DoDeferredTaggedToINoSSE2(LTaggedToINoSSE2* instr);
155 void DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr); 161 void DoDeferredMathAbsTaggedHeapNumber(LMathAbs* instr);
156 void DoDeferredStackCheck(LStackCheck* instr); 162 void DoDeferredStackCheck(LStackCheck* instr);
157 void DoDeferredRandom(LRandom* instr); 163 void DoDeferredRandom(LRandom* instr);
158 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); 164 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
159 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); 165 void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
160 void DoDeferredAllocateObject(LAllocateObject* instr);
161 void DoDeferredAllocate(LAllocate* instr); 166 void DoDeferredAllocate(LAllocate* instr);
162 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, 167 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
163 Label* map_check); 168 Label* map_check);
164 169
165 void DoCheckMapCommon(Register reg, Handle<Map> map, LInstruction* instr); 170 void DoCheckMapCommon(Register reg, Handle<Map> map, LInstruction* instr);
166 171
167 // Parallel move support. 172 // Parallel move support.
168 void DoParallelMove(LParallelMove* move); 173 void DoParallelMove(LParallelMove* move);
169 void DoGap(LGap* instr); 174 void DoGap(LGap* instr);
170 175
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 bool is_tagged, 290 bool is_tagged,
286 bool is_uint32); 291 bool is_uint32);
287 void RegisterDependentCodeForEmbeddedMaps(Handle<Code> code); 292 void RegisterDependentCodeForEmbeddedMaps(Handle<Code> code);
288 void PopulateDeoptimizationData(Handle<Code> code); 293 void PopulateDeoptimizationData(Handle<Code> code);
289 int DefineDeoptimizationLiteral(Handle<Object> literal); 294 int DefineDeoptimizationLiteral(Handle<Object> literal);
290 295
291 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); 296 void PopulateDeoptimizationLiteralsWithInlinedFunctions();
292 297
293 Register ToRegister(int index) const; 298 Register ToRegister(int index) const;
294 XMMRegister ToDoubleRegister(int index) const; 299 XMMRegister ToDoubleRegister(int index) const;
300 X87Register ToX87Register(int index) const;
295 int ToInteger32(LConstantOperand* op) const; 301 int ToInteger32(LConstantOperand* op) const;
296 302
297 Operand BuildFastArrayOperand(LOperand* elements_pointer, 303 Operand BuildFastArrayOperand(LOperand* elements_pointer,
298 LOperand* key, 304 LOperand* key,
299 Representation key_representation, 305 Representation key_representation,
300 ElementsKind elements_kind, 306 ElementsKind elements_kind,
301 uint32_t offset, 307 uint32_t offset,
302 uint32_t additional_index = 0); 308 uint32_t additional_index = 0);
303 309
304 void EmitIntegerMathAbs(LMathAbs* instr); 310 void EmitIntegerMathAbs(LMathAbs* instr);
(...skipping 19 matching lines...) Expand all
324 Register temp, 330 Register temp,
325 XMMRegister result, 331 XMMRegister result,
326 bool allow_undefined_as_nan, 332 bool allow_undefined_as_nan,
327 bool deoptimize_on_minus_zero, 333 bool deoptimize_on_minus_zero,
328 LEnvironment* env, 334 LEnvironment* env,
329 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); 335 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED);
330 336
331 void EmitNumberUntagDNoSSE2( 337 void EmitNumberUntagDNoSSE2(
332 Register input, 338 Register input,
333 Register temp, 339 Register temp,
340 X87Register res_reg,
334 bool allow_undefined_as_nan, 341 bool allow_undefined_as_nan,
335 bool deoptimize_on_minus_zero, 342 bool deoptimize_on_minus_zero,
336 LEnvironment* env, 343 LEnvironment* env,
337 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED); 344 NumberUntagDMode mode = NUMBER_CANDIDATE_IS_ANY_TAGGED);
338 345
339 // Emits optimized code for typeof x == "y". Modifies input register. 346 // Emits optimized code for typeof x == "y". Modifies input register.
340 // Returns the condition on which a final split to 347 // Returns the condition on which a final split to
341 // true and false label should be made, to optimize fallthrough. 348 // true and false label should be made, to optimize fallthrough.
342 Condition EmitTypeofIs(Label* true_label, 349 Condition EmitTypeofIs(Label* true_label,
343 Label* false_label, 350 Label* false_label,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 void DoStoreKeyedExternalArray(LStoreKeyed* instr); 392 void DoStoreKeyedExternalArray(LStoreKeyed* instr);
386 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr); 393 void DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr);
387 void DoStoreKeyedFixedArray(LStoreKeyed* instr); 394 void DoStoreKeyedFixedArray(LStoreKeyed* instr);
388 395
389 void EmitReturn(LReturn* instr, bool dynamic_frame_alignment); 396 void EmitReturn(LReturn* instr, bool dynamic_frame_alignment);
390 397
391 // Emits code for pushing either a tagged constant, a (non-double) 398 // Emits code for pushing either a tagged constant, a (non-double)
392 // register, or a stack slot operand. 399 // register, or a stack slot operand.
393 void EmitPushTaggedOperand(LOperand* operand); 400 void EmitPushTaggedOperand(LOperand* operand);
394 401
402 void X87Fxch(X87Register reg, int other_slot = 0);
403 void X87Fld(Operand src, X87OperandType opts);
404 void X87Free(X87Register reg);
405
406 void FlushX87StackIfNecessary(LInstruction* instr);
407 void EmitFlushX87ForDeopt();
408 bool X87StackContains(X87Register reg);
409 int X87ArrayIndex(X87Register reg);
410 int x87_st2idx(int pos);
411
395 Zone* zone_; 412 Zone* zone_;
396 LPlatformChunk* const chunk_; 413 LPlatformChunk* const chunk_;
397 MacroAssembler* const masm_; 414 MacroAssembler* const masm_;
398 CompilationInfo* const info_; 415 CompilationInfo* const info_;
399 416
400 int current_block_; 417 int current_block_;
401 int current_instruction_; 418 int current_instruction_;
402 const ZoneList<LInstruction*>* instructions_; 419 const ZoneList<LInstruction*>* instructions_;
403 ZoneList<LEnvironment*> deoptimizations_; 420 ZoneList<LEnvironment*> deoptimizations_;
404 ZoneList<Deoptimizer::JumpTableEntry> jump_table_; 421 ZoneList<Deoptimizer::JumpTableEntry> jump_table_;
405 ZoneList<Handle<Object> > deoptimization_literals_; 422 ZoneList<Handle<Object> > deoptimization_literals_;
406 int inlined_function_count_; 423 int inlined_function_count_;
407 Scope* const scope_; 424 Scope* const scope_;
408 Status status_; 425 Status status_;
409 TranslationBuffer translations_; 426 TranslationBuffer translations_;
410 ZoneList<LDeferredCode*> deferred_; 427 ZoneList<LDeferredCode*> deferred_;
411 bool dynamic_frame_alignment_; 428 bool dynamic_frame_alignment_;
412 bool support_aligned_spilled_doubles_; 429 bool support_aligned_spilled_doubles_;
413 int osr_pc_offset_; 430 int osr_pc_offset_;
414 int last_lazy_deopt_pc_; 431 int last_lazy_deopt_pc_;
415 bool frame_is_built_; 432 bool frame_is_built_;
433 X87Register x87_stack_[X87Register::kNumAllocatableRegisters];
416 int x87_stack_depth_; 434 int x87_stack_depth_;
417 435
418 // Builder that keeps track of safepoints in the code. The table 436 // Builder that keeps track of safepoints in the code. The table
419 // itself is emitted at the end of the generated code. 437 // itself is emitted at the end of the generated code.
420 SafepointTableBuilder safepoints_; 438 SafepointTableBuilder safepoints_;
421 439
422 // Compiler from a set of parallel moves to a sequential list of moves. 440 // Compiler from a set of parallel moves to a sequential list of moves.
423 LGapResolver resolver_; 441 LGapResolver resolver_;
424 442
425 Safepoint::Kind expected_safepoint_kind_; 443 Safepoint::Kind expected_safepoint_kind_;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 LCodeGen* codegen_; 495 LCodeGen* codegen_;
478 Label entry_; 496 Label entry_;
479 Label exit_; 497 Label exit_;
480 Label* external_exit_; 498 Label* external_exit_;
481 int instruction_index_; 499 int instruction_index_;
482 }; 500 };
483 501
484 } } // namespace v8::internal 502 } } // namespace v8::internal
485 503
486 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ 504 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698