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

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

Issue 263243002: Enables many language tests for arm64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/assembler_arm64_test.cc ('k') | runtime/vm/constants_arm64.h » ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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" // Needed here to get TARGET_ARCH_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/code_patcher.h" 8 #include "vm/code_patcher.h"
9 9
10 #include "vm/instructions.h" 10 #include "vm/instructions.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 CallPattern static_call(return_address, code); 91 CallPattern static_call(return_address, code);
92 ICData& ic_data = ICData::Handle(); 92 ICData& ic_data = ICData::Handle();
93 ic_data ^= static_call.IcData(); 93 ic_data ^= static_call.IcData();
94 if (ic_data_result != NULL) { 94 if (ic_data_result != NULL) {
95 *ic_data_result = ic_data.raw(); 95 *ic_data_result = ic_data.raw();
96 } 96 }
97 return ic_data.GetTargetAt(0); 97 return ic_data.GetTargetAt(0);
98 } 98 }
99 99
100 100
101 // This class pattern matches on a load from the object pool. Loading on
102 // ARM64 is complicated because it can take more than one form. We
103 // match backwards from the end of the sequence so we can reuse the code for
104 // matching object pool loads at calls.
105 class EdgeCounter : public ValueObject {
106 public:
107 EdgeCounter(uword pc, const Code& code)
108 : end_(pc - kAdjust), object_pool_(Array::Handle(code.ObjectPool())) {
109 // An IsValid predicate is complicated and duplicates the code in the
110 // decoding function. Instead we rely on decoding the pattern which
111 // will assert partial validity.
112 }
113
114 RawObject* edge_counter() const {
115 Register ignored;
116 intptr_t index;
117 InstructionPattern::DecodeLoadWordFromPool(end_, &ignored, &index);
118 ASSERT(ignored == R0);
119 return object_pool_.At(index);
120 }
121
122 private:
123 // The object pool load is followed by the fixed-size edge counter
124 // incrementing code:
125 // ldr ip, [r0, #+11]
126 // adds ip, ip, #2
127 // str ip, [r0, #+11]
128 static const intptr_t kAdjust = 3 * Instr::kInstrSize;
129
130 uword end_;
131 const Array& object_pool_;
132 };
133
134
101 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) { 135 RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
102 UNIMPLEMENTED(); 136 ASSERT(code.ContainsInstructionAt(pc));
103 return NULL; 137 EdgeCounter counter(pc, code);
138 return counter.edge_counter();
104 } 139 }
105 140
106 } // namespace dart 141 } // namespace dart
107 142
108 #endif // defined TARGET_ARCH_ARM64 143 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64_test.cc ('k') | runtime/vm/constants_arm64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698