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" | 5 #include "vm/globals.h" |
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/heap.h" | 9 #include "vm/heap.h" |
10 #include "vm/memory_region.h" | 10 #include "vm/memory_region.h" |
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2218 } | 2218 } |
2219 // If the call is patchable, do not reuse an existing entry since each | 2219 // If the call is patchable, do not reuse an existing entry since each |
2220 // reference may be patched independently. | 2220 // reference may be patched independently. |
2221 object_pool_.Add(smi, Heap::kOld); | 2221 object_pool_.Add(smi, Heap::kOld); |
2222 patchable_pool_entries_.Add(patchable); | 2222 patchable_pool_entries_.Add(patchable); |
2223 return object_pool_.Length() - 1; | 2223 return object_pool_.Length() - 1; |
2224 } | 2224 } |
2225 | 2225 |
2226 | 2226 |
2227 bool Assembler::CanLoadFromObjectPool(const Object& object) { | 2227 bool Assembler::CanLoadFromObjectPool(const Object& object) { |
2228 // TODO(zra, kmillikin): Move the use of large Smis into the constant pool. | 2228 // TODO(zra, kmillikin): Move the use of large Smis into the constant pool. |
Florian Schneider
2013/09/25 14:13:28
Update the TODO comment?
zra
2013/09/25 15:27:07
Done.
| |
2229 if (object.IsSmi()) { | 2229 if (object.IsSmi()) { |
2230 return false; | 2230 // If the raw Smi does not fit into a 32-bit signed int, then we'll keep |
Florian Schneider
2013/09/25 14:13:28
s/Smi/smi
zra
2013/09/25 15:27:07
Done.
| |
2231 // the raw value in the object pool. | |
2232 return !Utils::IsInt(32, reinterpret_cast<int64_t>(object.raw())); | |
2231 } | 2233 } |
2232 ASSERT(object.IsNotTemporaryScopedHandle()); | 2234 ASSERT(object.IsNotTemporaryScopedHandle()); |
2233 ASSERT(object.IsOld()); | 2235 ASSERT(object.IsOld()); |
2234 return (Isolate::Current() != Dart::vm_isolate()) && | 2236 return (Isolate::Current() != Dart::vm_isolate()) && |
2235 // Not in the VMHeap, OR is one of the VMHeap objects we put in every | 2237 // Not in the VMHeap, OR is one of the VMHeap objects we put in every |
2236 // object pool. | 2238 // object pool. |
2237 // TODO(zra): Evaluate putting all VM heap objects into the pool. | 2239 // TODO(zra): Evaluate putting all VM heap objects into the pool. |
2238 (!object.InVMHeap() || (object.raw() == Object::null()) || | 2240 (!object.InVMHeap() || (object.raw() == Object::null()) || |
2239 (object.raw() == Bool::True().raw()) || | 2241 (object.raw() == Bool::True().raw()) || |
2240 (object.raw() == Bool::False().raw())); | 2242 (object.raw() == Bool::False().raw())); |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2879 | 2881 |
2880 | 2882 |
2881 const char* Assembler::FpuRegisterName(FpuRegister reg) { | 2883 const char* Assembler::FpuRegisterName(FpuRegister reg) { |
2882 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); | 2884 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); |
2883 return xmm_reg_names[reg]; | 2885 return xmm_reg_names[reg]; |
2884 } | 2886 } |
2885 | 2887 |
2886 } // namespace dart | 2888 } // namespace dart |
2887 | 2889 |
2888 #endif // defined TARGET_ARCH_X64 | 2890 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |