Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: runtime/vm/assembler_x64.cc

Issue 1231463002: Don't bother trying to reuse object pool entries for ICs, type test caches, or edge counters as the… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after
2827 // forces the address operand to use a fixed-size imm32 encoding. 2827 // forces the address operand to use a fixed-size imm32 encoding.
2828 movq(dst, Address::AddressBaseImm32(pp, offset)); 2828 movq(dst, Address::AddressBaseImm32(pp, offset));
2829 } 2829 }
2830 2830
2831 2831
2832 void Assembler::LoadIsolate(Register dst) { 2832 void Assembler::LoadIsolate(Register dst) {
2833 movq(dst, Address(THR, Thread::isolate_offset())); 2833 movq(dst, Address(THR, Thread::isolate_offset()));
2834 } 2834 }
2835 2835
2836 2836
2837 void Assembler::LoadObject(Register dst, const Object& object, Register pp) { 2837 void Assembler::LoadObjectHelper(Register dst,
2838 const Object& object,
2839 Register pp,
2840 bool is_unique) {
2838 if (CanLoadFromObjectPool(object)) { 2841 if (CanLoadFromObjectPool(object)) {
2839 const int32_t offset = 2842 const int32_t offset = ObjectPool::element_offset(
2840 ObjectPool::element_offset(object_pool_wrapper_.FindObject(object)); 2843 is_unique ? object_pool_wrapper_.AddObject(object)
2844 : object_pool_wrapper_.FindObject(object));
2841 LoadWordFromPoolOffset(dst, pp, offset - kHeapObjectTag); 2845 LoadWordFromPoolOffset(dst, pp, offset - kHeapObjectTag);
2842 } else { 2846 } else {
2843 ASSERT((Isolate::Current() == Dart::vm_isolate()) || 2847 ASSERT((Isolate::Current() == Dart::vm_isolate()) ||
2844 object.IsSmi() || 2848 object.IsSmi() ||
2845 object.InVMHeap()); 2849 object.InVMHeap());
2846 LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp); 2850 LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp);
2847 } 2851 }
2848 } 2852 }
2849 2853
2850 2854
2855 void Assembler::LoadObject(Register dst, const Object& object, Register pp) {
2856 LoadObjectHelper(dst, object, pp, false);
2857 }
2858
2859
2860 void Assembler::LoadUniqueObject(Register dst,
2861 const Object& object,
2862 Register pp) {
2863 LoadObjectHelper(dst, object, pp, true);
2864 }
2865
2866
2851 void Assembler::StoreObject(const Address& dst, const Object& object, 2867 void Assembler::StoreObject(const Address& dst, const Object& object,
2852 Register pp) { 2868 Register pp) {
2853 if (CanLoadFromObjectPool(object)) { 2869 if (CanLoadFromObjectPool(object)) {
2854 LoadObject(TMP, object, pp); 2870 LoadObject(TMP, object, pp);
2855 movq(dst, TMP); 2871 movq(dst, TMP);
2856 } else { 2872 } else {
2857 MoveImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp); 2873 MoveImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())), pp);
2858 } 2874 }
2859 } 2875 }
2860 2876
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 3940
3925 3941
3926 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3942 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3927 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3943 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3928 return xmm_reg_names[reg]; 3944 return xmm_reg_names[reg];
3929 } 3945 }
3930 3946
3931 } // namespace dart 3947 } // namespace dart
3932 3948
3933 #endif // defined TARGET_ARCH_X64 3949 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/flow_graph_compiler_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698