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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 985 |
986 | 986 |
987 bool MacroAssembler::IsUnsafeInt(const int x) { | 987 bool MacroAssembler::IsUnsafeInt(const int x) { |
988 static const int kMaxBits = 17; | 988 static const int kMaxBits = 17; |
989 return !is_intn(x, kMaxBits); | 989 return !is_intn(x, kMaxBits); |
990 } | 990 } |
991 | 991 |
992 | 992 |
993 void MacroAssembler::SafeMove(Register dst, Smi* src) { | 993 void MacroAssembler::SafeMove(Register dst, Smi* src) { |
994 ASSERT(!dst.is(kScratchRegister)); | 994 ASSERT(!dst.is(kScratchRegister)); |
995 ASSERT(kSmiValueSize == 32); // JIT cookie can be converted to Smi. | 995 ASSERT(SmiValuesAre32Bits()); // JIT cookie can be converted to Smi. |
996 if (IsUnsafeInt(src->value()) && jit_cookie() != 0) { | 996 if (IsUnsafeInt(src->value()) && jit_cookie() != 0) { |
997 Move(dst, Smi::FromInt(src->value() ^ jit_cookie())); | 997 Move(dst, Smi::FromInt(src->value() ^ jit_cookie())); |
998 Move(kScratchRegister, Smi::FromInt(jit_cookie())); | 998 Move(kScratchRegister, Smi::FromInt(jit_cookie())); |
999 xor_(dst, kScratchRegister); | 999 xor_(dst, kScratchRegister); |
1000 } else { | 1000 } else { |
1001 Move(dst, src); | 1001 Move(dst, src); |
1002 } | 1002 } |
1003 } | 1003 } |
1004 | 1004 |
1005 | 1005 |
1006 void MacroAssembler::SafePush(Smi* src) { | 1006 void MacroAssembler::SafePush(Smi* src) { |
1007 ASSERT(kSmiValueSize == 32); // JIT cookie can be converted to Smi. | 1007 ASSERT(SmiValuesAre32Bits()); // JIT cookie can be converted to Smi. |
1008 if (IsUnsafeInt(src->value()) && jit_cookie() != 0) { | 1008 if (IsUnsafeInt(src->value()) && jit_cookie() != 0) { |
1009 Push(Smi::FromInt(src->value() ^ jit_cookie())); | 1009 Push(Smi::FromInt(src->value() ^ jit_cookie())); |
1010 Move(kScratchRegister, Smi::FromInt(jit_cookie())); | 1010 Move(kScratchRegister, Smi::FromInt(jit_cookie())); |
1011 xor_(Operand(rsp, 0), kScratchRegister); | 1011 xor_(Operand(rsp, 0), kScratchRegister); |
1012 } else { | 1012 } else { |
1013 Push(src); | 1013 Push(src); |
1014 } | 1014 } |
1015 } | 1015 } |
1016 | 1016 |
1017 | 1017 |
(...skipping 3676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4694 j(greater, &no_memento_available); | 4694 j(greater, &no_memento_available); |
4695 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), | 4695 CompareRoot(MemOperand(scratch_reg, -AllocationMemento::kSize), |
4696 Heap::kAllocationMementoMapRootIndex); | 4696 Heap::kAllocationMementoMapRootIndex); |
4697 bind(&no_memento_available); | 4697 bind(&no_memento_available); |
4698 } | 4698 } |
4699 | 4699 |
4700 | 4700 |
4701 } } // namespace v8::internal | 4701 } } // namespace v8::internal |
4702 | 4702 |
4703 #endif // V8_TARGET_ARCH_X64 | 4703 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |