OLD | NEW |
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 X87Register ToX87Register(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 ToImmediate(LOperand* op, const Representation& r) const { |
113 return Immediate(ToInteger32(LConstantOperand::cast(op))); | 113 return Immediate(ToRepresentation(LConstantOperand::cast(op), r)); |
114 } | |
115 Immediate ToSmiImmediate(LOperand* op) const { | |
116 return Immediate(Smi::FromInt(ToInteger32(LConstantOperand::cast(op)))); | |
117 } | 114 } |
118 double ToDouble(LConstantOperand* op) const; | 115 double ToDouble(LConstantOperand* op) const; |
119 | 116 |
120 // Support for non-sse2 (x87) floating point stack handling. | 117 // Support for non-sse2 (x87) floating point stack handling. |
121 // These functions maintain the mapping of physical stack registers to our | 118 // These functions maintain the mapping of physical stack registers to our |
122 // virtual registers between instructions. | 119 // virtual registers between instructions. |
123 enum X87OperandType { kX87DoubleOperand, kX87FloatOperand, kX87IntOperand }; | 120 enum X87OperandType { kX87DoubleOperand, kX87FloatOperand, kX87IntOperand }; |
124 | 121 |
125 void X87Mov(X87Register reg, Operand src, | 122 void X87Mov(X87Register reg, Operand src, |
126 X87OperandType operand = kX87DoubleOperand); | 123 X87OperandType operand = kX87DoubleOperand); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 273 |
277 void RecordSafepointWithLazyDeopt(LInstruction* instr, | 274 void RecordSafepointWithLazyDeopt(LInstruction* instr, |
278 SafepointMode safepoint_mode); | 275 SafepointMode safepoint_mode); |
279 | 276 |
280 void RegisterEnvironmentForDeoptimization(LEnvironment* environment, | 277 void RegisterEnvironmentForDeoptimization(LEnvironment* environment, |
281 Safepoint::DeoptMode mode); | 278 Safepoint::DeoptMode mode); |
282 void DeoptimizeIf(Condition cc, | 279 void DeoptimizeIf(Condition cc, |
283 LEnvironment* environment, | 280 LEnvironment* environment, |
284 Deoptimizer::BailoutType bailout_type); | 281 Deoptimizer::BailoutType bailout_type); |
285 void DeoptimizeIf(Condition cc, LEnvironment* environment); | 282 void DeoptimizeIf(Condition cc, LEnvironment* environment); |
286 void SoftDeoptimize(LEnvironment* environment); | 283 void ApplyCheckIf(Condition cc, LBoundsCheck* check); |
287 | 284 |
288 void AddToTranslation(Translation* translation, | 285 void AddToTranslation(Translation* translation, |
289 LOperand* op, | 286 LOperand* op, |
290 bool is_tagged, | 287 bool is_tagged, |
291 bool is_uint32); | 288 bool is_uint32); |
292 void RegisterDependentCodeForEmbeddedMaps(Handle<Code> code); | 289 void RegisterDependentCodeForEmbeddedMaps(Handle<Code> code); |
293 void PopulateDeoptimizationData(Handle<Code> code); | 290 void PopulateDeoptimizationData(Handle<Code> code); |
294 int DefineDeoptimizationLiteral(Handle<Object> literal); | 291 int DefineDeoptimizationLiteral(Handle<Object> literal); |
295 | 292 |
296 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 293 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
297 | 294 |
298 Register ToRegister(int index) const; | 295 Register ToRegister(int index) const; |
299 XMMRegister ToDoubleRegister(int index) const; | 296 XMMRegister ToDoubleRegister(int index) const; |
300 X87Register ToX87Register(int index) const; | 297 X87Register ToX87Register(int index) const; |
301 int ToInteger32(LConstantOperand* op) const; | 298 int ToRepresentation(LConstantOperand* op, const Representation& r) const; |
| 299 int32_t ToInteger32(LConstantOperand* op) const; |
302 | 300 |
303 Operand BuildFastArrayOperand(LOperand* elements_pointer, | 301 Operand BuildFastArrayOperand(LOperand* elements_pointer, |
304 LOperand* key, | 302 LOperand* key, |
305 Representation key_representation, | 303 Representation key_representation, |
306 ElementsKind elements_kind, | 304 ElementsKind elements_kind, |
307 uint32_t offset, | 305 uint32_t offset, |
308 uint32_t additional_index = 0); | 306 uint32_t additional_index = 0); |
309 | 307 |
310 void EmitIntegerMathAbs(LMathAbs* instr); | 308 void EmitIntegerMathAbs(LMathAbs* instr); |
311 | 309 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // true and false label should be made, to optimize fallthrough. | 362 // true and false label should be made, to optimize fallthrough. |
365 Condition EmitIsString(Register input, | 363 Condition EmitIsString(Register input, |
366 Register temp1, | 364 Register temp1, |
367 Label* is_not_string, | 365 Label* is_not_string, |
368 SmiCheck check_needed); | 366 SmiCheck check_needed); |
369 | 367 |
370 // Emits optimized code for %_IsConstructCall(). | 368 // Emits optimized code for %_IsConstructCall(). |
371 // Caller should branch on equal condition. | 369 // Caller should branch on equal condition. |
372 void EmitIsConstructCall(Register temp); | 370 void EmitIsConstructCall(Register temp); |
373 | 371 |
374 void EmitLoadFieldOrConstantFunction(Register result, | 372 void EmitLoadFieldOrConstant(Register result, |
375 Register object, | 373 Register object, |
376 Handle<Map> type, | 374 Handle<Map> type, |
377 Handle<String> name, | 375 Handle<String> name, |
378 LEnvironment* env); | 376 LEnvironment* env); |
379 | 377 |
380 // Emits optimized code to deep-copy the contents of statically known | 378 // Emits optimized code to deep-copy the contents of statically known |
381 // object graphs (e.g. object literal boilerplate). | 379 // object graphs (e.g. object literal boilerplate). |
382 void EmitDeepCopy(Handle<JSObject> object, | 380 void EmitDeepCopy(Handle<JSObject> object, |
383 Register result, | 381 Register result, |
384 Register source, | 382 Register source, |
385 int* offset, | 383 int* offset, |
386 AllocationSiteMode mode); | 384 AllocationSiteMode mode); |
387 | 385 |
388 void EnsureSpaceForLazyDeopt(); | 386 void EnsureSpaceForLazyDeopt(); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 LCodeGen* codegen_; | 493 LCodeGen* codegen_; |
496 Label entry_; | 494 Label entry_; |
497 Label exit_; | 495 Label exit_; |
498 Label* external_exit_; | 496 Label* external_exit_; |
499 int instruction_index_; | 497 int instruction_index_; |
500 }; | 498 }; |
501 | 499 |
502 } } // namespace v8::internal | 500 } } // namespace v8::internal |
503 | 501 |
504 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ | 502 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ |
OLD | NEW |