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

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

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed Slava's feedback Created 6 years, 3 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_mips.h ('k') | runtime/vm/assembler_x64.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) 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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/longjump.h" 9 #include "vm/longjump.h"
10 #include "vm/runtime_entry.h" 10 #include "vm/runtime_entry.h"
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 buffer_.Store<int32_t>(position, encoded); 348 buffer_.Store<int32_t>(position, encoded);
349 label->position_ = DecodeBranchOffset(next); 349 label->position_ = DecodeBranchOffset(next);
350 } 350 }
351 } 351 }
352 label->BindTo(bound_pc); 352 label->BindTo(bound_pc);
353 delay_slot_available_ = false; 353 delay_slot_available_ = false;
354 } 354 }
355 355
356 356
357 void Assembler::LoadWordFromPoolOffset(Register rd, int32_t offset) { 357 void Assembler::LoadWordFromPoolOffset(Register rd, int32_t offset) {
358 ASSERT(allow_constant_pool());
358 ASSERT(!in_delay_slot_); 359 ASSERT(!in_delay_slot_);
359 ASSERT(rd != PP); 360 ASSERT(rd != PP);
360 if (Address::CanHoldOffset(offset)) { 361 if (Address::CanHoldOffset(offset)) {
361 lw(rd, Address(PP, offset)); 362 lw(rd, Address(PP, offset));
362 } else { 363 } else {
363 const int16_t offset_low = Utils::Low16Bits(offset); // Signed. 364 const int16_t offset_low = Utils::Low16Bits(offset); // Signed.
364 offset -= offset_low; 365 offset -= offset_low;
365 const uint16_t offset_high = Utils::High16Bits(offset); // Unsigned. 366 const uint16_t offset_high = Utils::High16Bits(offset); // Unsigned.
366 if (offset_high != 0) { 367 if (offset_high != 0) {
367 lui(rd, Immediate(offset_high)); 368 lui(rd, Immediate(offset_high));
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 and_(ro, TMP, ro); 454 and_(ro, TMP, ro);
454 } 455 }
455 } 456 }
456 457
457 458
458 void Assembler::LoadObject(Register rd, const Object& object) { 459 void Assembler::LoadObject(Register rd, const Object& object) {
459 ASSERT(!in_delay_slot_); 460 ASSERT(!in_delay_slot_);
460 // Smis and VM heap objects are never relocated; do not use object pool. 461 // Smis and VM heap objects are never relocated; do not use object pool.
461 if (object.IsSmi()) { 462 if (object.IsSmi()) {
462 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); 463 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()));
463 } else if (object.InVMHeap()) { 464 } else if (object.InVMHeap() || !allow_constant_pool()) {
464 // Make sure that class CallPattern is able to decode this load immediate. 465 // Make sure that class CallPattern is able to decode this load immediate.
465 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); 466 int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
466 const uint16_t object_low = Utils::Low16Bits(object_raw); 467 const uint16_t object_low = Utils::Low16Bits(object_raw);
467 const uint16_t object_high = Utils::High16Bits(object_raw); 468 const uint16_t object_high = Utils::High16Bits(object_raw);
468 lui(rd, Immediate(object_high)); 469 lui(rd, Immediate(object_high));
469 ori(rd, rd, Immediate(object_low)); 470 ori(rd, rd, Immediate(object_low));
470 } else { 471 } else {
471 // Make sure that class CallPattern is able to decode this load from the 472 // Make sure that class CallPattern is able to decode this load from the
472 // object pool. 473 // object pool.
473 const int32_t offset = 474 const int32_t offset =
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 Emit(reinterpret_cast<int32_t>(message)); 1229 Emit(reinterpret_cast<int32_t>(message));
1229 Bind(&msg); 1230 Bind(&msg);
1230 break_(Instr::kMsgMessageCode); 1231 break_(Instr::kMsgMessageCode);
1231 } 1232 }
1232 #endif 1233 #endif
1233 } 1234 }
1234 1235
1235 } // namespace dart 1236 } // namespace dart
1236 1237
1237 #endif // defined TARGET_ARCH_MIPS 1238 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698