Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/heap.h" | 10 #include "vm/heap.h" |
| (...skipping 2824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2835 | 2835 |
| 2836 // TODO(zra, kmillikin): Also load other large immediates from the object | 2836 // TODO(zra, kmillikin): Also load other large immediates from the object |
| 2837 // pool | 2837 // pool |
| 2838 if (object.IsSmi()) { | 2838 if (object.IsSmi()) { |
| 2839 // If the raw smi does not fit into a 32-bit signed int, then we'll keep | 2839 // If the raw smi does not fit into a 32-bit signed int, then we'll keep |
| 2840 // the raw value in the object pool. | 2840 // the raw value in the object pool. |
| 2841 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); | 2841 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); |
| 2842 } | 2842 } |
| 2843 ASSERT(object.IsNotTemporaryScopedHandle()); | 2843 ASSERT(object.IsNotTemporaryScopedHandle()); |
| 2844 ASSERT(object.IsOld()); | 2844 ASSERT(object.IsOld()); |
| 2845 return (Isolate::Current() != Dart::vm_isolate()) && | 2845 return (Isolate::Current() != Dart::vm_isolate()); |
| 2846 // Not in the VMHeap, OR is one of the VMHeap objects we put in every | |
| 2847 // object pool. | |
| 2848 (!object.InVMHeap() || IsAlwaysInConstantPool(object)); | |
| 2849 } | 2846 } |
| 2850 | 2847 |
| 2851 | 2848 |
| 2852 void Assembler::LoadWordFromPoolOffset(Register dst, Register pp, | 2849 void Assembler::LoadWordFromPoolOffset(Register dst, Register pp, |
| 2853 int32_t offset) { | 2850 int32_t offset) { |
| 2854 // This sequence must be of fixed size. AddressBaseImm32 | 2851 // This sequence must be of fixed size. AddressBaseImm32 |
| 2855 // forces the address operand to use a fixed-size imm32 encoding. | 2852 // forces the address operand to use a fixed-size imm32 encoding. |
| 2856 movq(dst, Address::AddressBaseImm32(pp, offset)); | 2853 movq(dst, Address::AddressBaseImm32(pp, offset)); |
| 2857 } | 2854 } |
| 2858 | 2855 |
| 2859 | 2856 |
| 2860 void Assembler::LoadIsolate(Register dst) { | 2857 void Assembler::LoadIsolate(Register dst) { |
| 2861 movq(dst, Immediate(reinterpret_cast<uword>(Isolate::Current()))); | 2858 movq(dst, Immediate(reinterpret_cast<uword>(Isolate::Current()))); |
| 2862 } | 2859 } |
| 2863 | 2860 |
| 2864 | 2861 |
| 2865 void Assembler::LoadObject(Register dst, const Object& object, Register pp) { | 2862 void Assembler::LoadObject(Register dst, const Object& object, Register pp) { |
| 2866 if (CanLoadFromObjectPool(object)) { | 2863 if (CanLoadFromObjectPool(object)) { |
| 2867 const int32_t offset = | 2864 const int32_t offset = |
| 2868 Array::element_offset(FindObject(object, kNotPatchable)); | 2865 Array::element_offset(FindObject(object, kNotPatchable)); |
| 2869 LoadWordFromPoolOffset(dst, pp, offset - kHeapObjectTag); | 2866 LoadWordFromPoolOffset(dst, pp, offset - kHeapObjectTag); |
| 2870 } else { | 2867 } else { |
| 2871 ASSERT((Isolate::Current() == Dart::vm_isolate()) || | 2868 ASSERT((Isolate::Current() == Dart::vm_isolate()) || |
| 2872 object.IsSmi() || | 2869 object.IsSmi() || |
| 2873 object.InVMHeap()); | 2870 object.InVMHeap()); |
|
zra
2015/01/14 17:53:24
I don't think we need object.InVMHeap() here anymo
Vyacheslav Egorov (Google)
2015/01/14 17:56:33
Ditto
| |
| 2874 LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp); | 2871 LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp); |
| 2875 } | 2872 } |
| 2876 } | 2873 } |
| 2877 | 2874 |
| 2878 | 2875 |
| 2879 void Assembler::StoreObject(const Address& dst, const Object& object, | 2876 void Assembler::StoreObject(const Address& dst, const Object& object, |
| 2880 Register pp) { | 2877 Register pp) { |
| 2881 if (CanLoadFromObjectPool(object)) { | 2878 if (CanLoadFromObjectPool(object)) { |
| 2882 LoadObject(TMP, object, pp); | 2879 LoadObject(TMP, object, pp); |
| 2883 movq(dst, TMP); | 2880 movq(dst, TMP); |
| (...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4002 | 3999 |
| 4003 | 4000 |
| 4004 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 4001 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
| 4005 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 4002 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
| 4006 return xmm_reg_names[reg]; | 4003 return xmm_reg_names[reg]; |
| 4007 } | 4004 } |
| 4008 | 4005 |
| 4009 } // namespace dart | 4006 } // namespace dart |
| 4010 | 4007 |
| 4011 #endif // defined TARGET_ARCH_X64 | 4008 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |