OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 5 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 6 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
7 | 7 |
8 #include "assembler.h" | 8 #include "assembler.h" |
9 #include "frames.h" | 9 #include "frames.h" |
10 #include "v8globals.h" | 10 #include "v8globals.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 // Check to see if maybe_number can be stored as a double in | 364 // Check to see if maybe_number can be stored as a double in |
365 // FastDoubleElements. If it can, store it at the index specified by key in | 365 // FastDoubleElements. If it can, store it at the index specified by key in |
366 // the FastDoubleElements array elements, otherwise jump to fail. | 366 // the FastDoubleElements array elements, otherwise jump to fail. |
367 void StoreNumberToDoubleElements(Register maybe_number, | 367 void StoreNumberToDoubleElements(Register maybe_number, |
368 Register elements, | 368 Register elements, |
369 Register key, | 369 Register key, |
370 Register scratch1, | 370 Register scratch1, |
371 XMMRegister scratch2, | 371 XMMRegister scratch2, |
372 Label* fail, | 372 Label* fail, |
373 bool specialize_for_processor, | |
374 int offset = 0); | 373 int offset = 0); |
375 | 374 |
376 // Compare an object's map with the specified map. | 375 // Compare an object's map with the specified map. |
377 void CompareMap(Register obj, Handle<Map> map); | 376 void CompareMap(Register obj, Handle<Map> map); |
378 | 377 |
379 // Check if the map of an object is equal to a specified map and branch to | 378 // Check if the map of an object is equal to a specified map and branch to |
380 // label if not. Skip the smi check if not required (object is known to be a | 379 // label if not. Skip the smi check if not required (object is known to be a |
381 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match | 380 // heap object). If mode is ALLOW_ELEMENT_TRANSITION_MAPS, then also match |
382 // against maps that are ElementsKind transition maps of the specified map. | 381 // against maps that are ElementsKind transition maps of the specified map. |
383 void CheckMap(Register obj, | 382 void CheckMap(Register obj, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 431 |
433 void ClampDoubleToUint8(XMMRegister input_reg, | 432 void ClampDoubleToUint8(XMMRegister input_reg, |
434 XMMRegister scratch_reg, | 433 XMMRegister scratch_reg, |
435 Register result_reg); | 434 Register result_reg); |
436 | 435 |
437 void SlowTruncateToI(Register result_reg, Register input_reg, | 436 void SlowTruncateToI(Register result_reg, Register input_reg, |
438 int offset = HeapNumber::kValueOffset - kHeapObjectTag); | 437 int offset = HeapNumber::kValueOffset - kHeapObjectTag); |
439 | 438 |
440 void TruncateHeapNumberToI(Register result_reg, Register input_reg); | 439 void TruncateHeapNumberToI(Register result_reg, Register input_reg); |
441 void TruncateDoubleToI(Register result_reg, XMMRegister input_reg); | 440 void TruncateDoubleToI(Register result_reg, XMMRegister input_reg); |
442 void TruncateX87TOSToI(Register result_reg); | |
443 | 441 |
444 void DoubleToI(Register result_reg, XMMRegister input_reg, | 442 void DoubleToI(Register result_reg, XMMRegister input_reg, |
445 XMMRegister scratch, MinusZeroMode minus_zero_mode, | 443 XMMRegister scratch, MinusZeroMode minus_zero_mode, |
446 Label* conversion_failed, Label::Distance dst = Label::kFar); | 444 Label* conversion_failed, Label::Distance dst = Label::kFar); |
447 void X87TOSToI(Register result_reg, MinusZeroMode minus_zero_mode, | |
448 Label* conversion_failed, Label::Distance dst = Label::kFar); | |
449 | 445 |
450 void TaggedToI(Register result_reg, Register input_reg, XMMRegister temp, | 446 void TaggedToI(Register result_reg, Register input_reg, XMMRegister temp, |
451 MinusZeroMode minus_zero_mode, Label* lost_precision); | 447 MinusZeroMode minus_zero_mode, Label* lost_precision); |
452 | 448 |
453 // Smi tagging support. | 449 // Smi tagging support. |
454 void SmiTag(Register reg) { | 450 void SmiTag(Register reg) { |
455 STATIC_ASSERT(kSmiTag == 0); | 451 STATIC_ASSERT(kSmiTag == 0); |
456 STATIC_ASSERT(kSmiTagSize == 1); | 452 STATIC_ASSERT(kSmiTagSize == 1); |
457 add(reg, reg); | 453 add(reg, reg); |
458 } | 454 } |
459 void SmiUntag(Register reg) { | 455 void SmiUntag(Register reg) { |
460 sar(reg, kSmiTagSize); | 456 sar(reg, kSmiTagSize); |
461 } | 457 } |
462 | 458 |
463 // Modifies the register even if it does not contain a Smi! | 459 // Modifies the register even if it does not contain a Smi! |
464 void SmiUntag(Register reg, Label* is_smi) { | 460 void SmiUntag(Register reg, Label* is_smi) { |
465 STATIC_ASSERT(kSmiTagSize == 1); | 461 STATIC_ASSERT(kSmiTagSize == 1); |
466 sar(reg, kSmiTagSize); | 462 sar(reg, kSmiTagSize); |
467 STATIC_ASSERT(kSmiTag == 0); | 463 STATIC_ASSERT(kSmiTag == 0); |
468 j(not_carry, is_smi); | 464 j(not_carry, is_smi); |
469 } | 465 } |
470 | 466 |
471 void LoadUint32(XMMRegister dst, Register src, XMMRegister scratch); | 467 void LoadUint32(XMMRegister dst, Register src, XMMRegister scratch); |
472 void LoadUint32NoSSE2(Register src); | |
473 | 468 |
474 // Jump the register contains a smi. | 469 // Jump the register contains a smi. |
475 inline void JumpIfSmi(Register value, | 470 inline void JumpIfSmi(Register value, |
476 Label* smi_label, | 471 Label* smi_label, |
477 Label::Distance distance = Label::kFar) { | 472 Label::Distance distance = Label::kFar) { |
478 test(value, Immediate(kSmiTagMask)); | 473 test(value, Immediate(kSmiTagMask)); |
479 j(zero, smi_label, distance); | 474 j(zero, smi_label, distance); |
480 } | 475 } |
481 // Jump if the operand is a smi. | 476 // Jump if the operand is a smi. |
482 inline void JumpIfSmi(Operand value, | 477 inline void JumpIfSmi(Operand value, |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 | 819 |
825 // Push a handle value. | 820 // Push a handle value. |
826 void Push(Handle<Object> handle) { push(Immediate(handle)); } | 821 void Push(Handle<Object> handle) { push(Immediate(handle)); } |
827 void Push(Smi* smi) { Push(Handle<Smi>(smi, isolate())); } | 822 void Push(Smi* smi) { Push(Handle<Smi>(smi, isolate())); } |
828 | 823 |
829 Handle<Object> CodeObject() { | 824 Handle<Object> CodeObject() { |
830 ASSERT(!code_object_.is_null()); | 825 ASSERT(!code_object_.is_null()); |
831 return code_object_; | 826 return code_object_; |
832 } | 827 } |
833 | 828 |
834 // Insert code to verify that the x87 stack has the specified depth (0-7) | |
835 void VerifyX87StackDepth(uint32_t depth); | |
836 | |
837 // Emit code for a truncating division by a constant. The dividend register is | 829 // Emit code for a truncating division by a constant. The dividend register is |
838 // unchanged, the result is in edx, and eax gets clobbered. | 830 // unchanged, the result is in edx, and eax gets clobbered. |
839 void TruncatingDiv(Register dividend, int32_t divisor); | 831 void TruncatingDiv(Register dividend, int32_t divisor); |
840 | 832 |
841 // --------------------------------------------------------------------------- | 833 // --------------------------------------------------------------------------- |
842 // StatsCounter support | 834 // StatsCounter support |
843 | 835 |
844 void SetCounter(StatsCounter* counter, int value); | 836 void SetCounter(StatsCounter* counter, int value); |
845 void IncrementCounter(StatsCounter* counter, int value); | 837 void IncrementCounter(StatsCounter* counter, int value); |
846 void DecrementCounter(StatsCounter* counter, int value); | 838 void DecrementCounter(StatsCounter* counter, int value); |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 } \ | 1082 } \ |
1091 masm-> | 1083 masm-> |
1092 #else | 1084 #else |
1093 #define ACCESS_MASM(masm) masm-> | 1085 #define ACCESS_MASM(masm) masm-> |
1094 #endif | 1086 #endif |
1095 | 1087 |
1096 | 1088 |
1097 } } // namespace v8::internal | 1089 } } // namespace v8::internal |
1098 | 1090 |
1099 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 1091 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |