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

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

Issue 1301963003: VM: Clean up and fix bugs in instructions patterns (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: s/Pattern::InstructionLength/Pattern::pattern_length_in_bytes/g Created 5 years, 4 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
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" // Needed here to get TARGET_ARCH_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/constants_mips.h" 8 #include "vm/constants_mips.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/instructions.h" 10 #include "vm/instructions.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 ASSERT(instr->RsField() == *reg); 111 ASSERT(instr->RsField() == *reg);
112 ASSERT(instr->RtField() == PP); 112 ASSERT(instr->RtField() == PP);
113 113
114 start -= Instr::kInstrSize; 114 start -= Instr::kInstrSize;
115 instr = Instr::At(start); 115 instr = Instr::At(start);
116 ASSERT(instr->OpcodeField() == LUI); 116 ASSERT(instr->OpcodeField() == LUI);
117 ASSERT(instr->RtField() == *reg); 117 ASSERT(instr->RtField() == *reg);
118 // Offset is signed, so add the upper 16 bits. 118 // Offset is signed, so add the upper 16 bits.
119 offset += (instr->UImmField() << 16); 119 offset += (instr->UImmField() << 16);
120 } 120 }
121 offset += kHeapObjectTag; 121 *index = ObjectPool::IndexFromOffset(offset);
122 ASSERT(Utils::IsAligned(offset, 4));
123 *index = (offset - Array::data_offset()) / 4;
124 return start; 122 return start;
125 } 123 }
126 124
127 125
128 RawICData* CallPattern::IcData() { 126 RawICData* CallPattern::IcData() {
129 if (ic_data_.IsNull()) { 127 if (ic_data_.IsNull()) {
130 Register reg; 128 Register reg;
131 args_desc_load_end_ = 129 args_desc_load_end_ =
132 InstructionPattern::DecodeLoadObject(ic_data_load_end_, 130 InstructionPattern::DecodeLoadObject(ic_data_load_end_,
133 object_pool_, 131 object_pool_,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 bool ReturnPattern::IsValid() const { 226 bool ReturnPattern::IsValid() const {
229 Instr* jr = Instr::At(pc_); 227 Instr* jr = Instr::At(pc_);
230 return (jr->OpcodeField() == SPECIAL) && 228 return (jr->OpcodeField() == SPECIAL) &&
231 (jr->FunctionField() == JR) && 229 (jr->FunctionField() == JR) &&
232 (jr->RsField() == RA); 230 (jr->RsField() == RA);
233 } 231 }
234 232
235 } // namespace dart 233 } // namespace dart
236 234
237 #endif // defined TARGET_ARCH_MIPS 235 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698