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

Side by Side Diff: runtime/vm/assembler_mips.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_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" // NOLINT 5 #include "vm/globals.h" // NOLINT
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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 and_(ro, TMP, ro); 449 and_(ro, TMP, ro);
450 } else { 450 } else {
451 subu(rd, rs, rt); 451 subu(rd, rs, rt);
452 xor_(ro, rd, rs); 452 xor_(ro, rd, rs);
453 xor_(TMP, rs, rt); 453 xor_(TMP, rs, rt);
454 and_(ro, TMP, ro); 454 and_(ro, TMP, ro);
455 } 455 }
456 } 456 }
457 457
458 458
459 void Assembler::LoadObject(Register rd, const Object& object) { 459 void Assembler::LoadObjectHelper(Register rd,
460 const Object& object,
461 bool is_unique) {
460 ASSERT(!in_delay_slot_); 462 ASSERT(!in_delay_slot_);
461 // Smis and VM heap objects are never relocated; do not use object pool. 463 // Smis and VM heap objects are never relocated; do not use object pool.
462 if (object.IsSmi()) { 464 if (object.IsSmi()) {
463 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw())); 465 LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()));
464 } else if (object.InVMHeap() || !allow_constant_pool()) { 466 } else if (object.InVMHeap() || !allow_constant_pool()) {
465 // Make sure that class CallPattern is able to decode this load immediate. 467 // Make sure that class CallPattern is able to decode this load immediate.
466 int32_t object_raw = reinterpret_cast<int32_t>(object.raw()); 468 int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
467 const uint16_t object_low = Utils::Low16Bits(object_raw); 469 const uint16_t object_low = Utils::Low16Bits(object_raw);
468 const uint16_t object_high = Utils::High16Bits(object_raw); 470 const uint16_t object_high = Utils::High16Bits(object_raw);
469 lui(rd, Immediate(object_high)); 471 lui(rd, Immediate(object_high));
470 ori(rd, rd, Immediate(object_low)); 472 ori(rd, rd, Immediate(object_low));
471 } else { 473 } else {
472 // Make sure that class CallPattern is able to decode this load from the 474 // Make sure that class CallPattern is able to decode this load from the
473 // object pool. 475 // object pool.
474 const int32_t offset = 476 const int32_t offset = ObjectPool::element_offset(
475 ObjectPool::element_offset(object_pool_wrapper_.FindObject(object)); 477 is_unique ? object_pool_wrapper_.AddObject(object)
478 : object_pool_wrapper_.FindObject(object));
476 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); 479 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag);
477 } 480 }
478 } 481 }
479 482
480 483
484 void Assembler::LoadObject(Register rd, const Object& object) {
485 LoadObjectHelper(rd, object, false);
486 }
487
488
489 void Assembler::LoadUniqueObject(Register rd, const Object& object) {
490 LoadObjectHelper(rd, object, true);
491 }
492
493
481 void Assembler::LoadExternalLabel(Register rd, 494 void Assembler::LoadExternalLabel(Register rd,
482 const ExternalLabel* label, 495 const ExternalLabel* label,
483 Patchability patchable) { 496 Patchability patchable) {
484 const int32_t offset = ObjectPool::element_offset( 497 const int32_t offset = ObjectPool::element_offset(
485 object_pool_wrapper_.FindExternalLabel(label, patchable)); 498 object_pool_wrapper_.FindExternalLabel(label, patchable));
486 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag); 499 LoadWordFromPoolOffset(rd, offset - kHeapObjectTag);
487 } 500 }
488 501
489 502
490 void Assembler::PushObject(const Object& object) { 503 void Assembler::PushObject(const Object& object) {
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1223 Label stop; 1236 Label stop;
1224 b(&stop); 1237 b(&stop);
1225 Emit(reinterpret_cast<int32_t>(message)); 1238 Emit(reinterpret_cast<int32_t>(message));
1226 Bind(&stop); 1239 Bind(&stop);
1227 break_(Instr::kStopMessageCode); 1240 break_(Instr::kStopMessageCode);
1228 } 1241 }
1229 1242
1230 } // namespace dart 1243 } // namespace dart
1231 1244
1232 #endif // defined TARGET_ARCH_MIPS 1245 #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