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

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

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.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" 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/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 __ lw(CMPRES1, Address(T0, Scavenger::end_offset())); 706 __ lw(CMPRES1, Address(T0, Scavenger::end_offset()));
707 __ BranchUnsignedGreaterEqual(T2, CMPRES1, &slow_case); 707 __ BranchUnsignedGreaterEqual(T2, CMPRES1, &slow_case);
708 708
709 // Successfully allocated the object(s), now update top to point to 709 // Successfully allocated the object(s), now update top to point to
710 // next object start and initialize the object. 710 // next object start and initialize the object.
711 // V0: potential new object start. 711 // V0: potential new object start.
712 // T2: potential next object start. 712 // T2: potential next object start.
713 // T0: Points to new space object. 713 // T0: Points to new space object.
714 __ sw(T2, Address(T0, Scavenger::top_offset())); 714 __ sw(T2, Address(T0, Scavenger::top_offset()));
715 __ addiu(V0, V0, Immediate(kHeapObjectTag)); 715 __ addiu(V0, V0, Immediate(kHeapObjectTag));
716 // T1: Size of allocation in bytes.
717 __ subu(T1, T2, V0);
718 __ UpdateAllocationStatsWithSize(kArrayCid, T1, T5);
716 719
717 // V0: new object start as a tagged pointer. 720 // V0: new object start as a tagged pointer.
718 // A0: array element type. 721 // A0: array element type.
719 // A1: Array length as Smi. 722 // A1: Array length as Smi.
720 // T2: new object end address. 723 // T2: new object end address.
721 724
722 // Store the type argument field. 725 // Store the type argument field.
723 __ StoreIntoObjectNoBarrier( 726 __ StoreIntoObjectNoBarrier(
724 V0, 727 V0,
725 FieldAddress(V0, Array::type_arguments_offset()), 728 FieldAddress(V0, Array::type_arguments_offset()),
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 } 1111 }
1109 1112
1110 // Successfully allocated the object, now update top to point to 1113 // Successfully allocated the object, now update top to point to
1111 // next object start and initialize the object. 1114 // next object start and initialize the object.
1112 // V0: new object. 1115 // V0: new object.
1113 // T1: number of context variables. 1116 // T1: number of context variables.
1114 // T2: object size. 1117 // T2: object size.
1115 // T3: next object start. 1118 // T3: next object start.
1116 __ sw(T3, Address(T5, 0)); 1119 __ sw(T3, Address(T5, 0));
1117 __ addiu(V0, V0, Immediate(kHeapObjectTag)); 1120 __ addiu(V0, V0, Immediate(kHeapObjectTag));
1121 __ UpdateAllocationStatsWithSize(context_class.id(), T2, T5);
1118 1122
1119 // Calculate the size tag. 1123 // Calculate the size tag.
1120 // V0: new object. 1124 // V0: new object.
1121 // T1: number of context variables. 1125 // T1: number of context variables.
1122 // T2: object size. 1126 // T2: object size.
1123 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; 1127 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2;
1124 __ LoadImmediate(TMP, RawObject::SizeTag::kMaxSizeTag); 1128 __ LoadImmediate(TMP, RawObject::SizeTag::kMaxSizeTag);
1125 __ sltu(CMPRES1, TMP, T2); // CMPRES1 = T2 > TMP ? 1 : 0. 1129 __ sltu(CMPRES1, TMP, T2); // CMPRES1 = T2 > TMP ? 1 : 0.
1126 __ movn(T2, ZR, CMPRES1); // T2 = CMPRES1 != 0 ? 0 : T2. 1130 __ movn(T2, ZR, CMPRES1); // T2 = CMPRES1 != 0 ? 0 : T2.
1127 __ sll(TMP, T2, shift); // TMP = T2 << shift. 1131 __ sll(TMP, T2, shift); // TMP = T2 << shift.
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 __ addiu(T4, T4, Immediate(kWordSize)); 1394 __ addiu(T4, T4, Immediate(kWordSize));
1391 __ bne(T4, T3, &loop); 1395 __ bne(T4, T3, &loop);
1392 __ delay_slot()->sw(T7, Address(T4, -kWordSize)); 1396 __ delay_slot()->sw(T7, Address(T4, -kWordSize));
1393 __ Bind(&loop_exit); 1397 __ Bind(&loop_exit);
1394 } 1398 }
1395 if (is_cls_parameterized) { 1399 if (is_cls_parameterized) {
1396 // R1: new object type arguments. 1400 // R1: new object type arguments.
1397 // Set the type arguments in the new object. 1401 // Set the type arguments in the new object.
1398 __ sw(T1, Address(T2, cls.type_arguments_field_offset())); 1402 __ sw(T1, Address(T2, cls.type_arguments_field_offset()));
1399 } 1403 }
1404 __ UpdateAllocationStats(cls.id(), T5);
1400 // Done allocating and initializing the instance. 1405 // Done allocating and initializing the instance.
1401 // T2: new object still missing its heap tag. 1406 // T2: new object still missing its heap tag.
1402 __ Ret(); 1407 __ Ret();
1403 __ delay_slot()->addiu(V0, T2, Immediate(kHeapObjectTag)); 1408 __ delay_slot()->addiu(V0, T2, Immediate(kHeapObjectTag));
1404 1409
1405 __ Bind(&slow_case); 1410 __ Bind(&slow_case);
1406 } 1411 }
1407 if (is_cls_parameterized) { 1412 if (is_cls_parameterized) {
1408 __ lw(T1, Address(SP, 1 * kWordSize)); 1413 __ lw(T1, Address(SP, 1 * kWordSize));
1409 __ lw(T0, Address(SP, 0 * kWordSize)); 1414 __ lw(T0, Address(SP, 0 * kWordSize));
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 __ lw(CMPRES1, Address(TMP)); 1484 __ lw(CMPRES1, Address(TMP));
1480 if (FLAG_use_slow_path) { 1485 if (FLAG_use_slow_path) {
1481 __ b(&slow_case); 1486 __ b(&slow_case);
1482 } else { 1487 } else {
1483 __ BranchUnsignedGreaterEqual(T3, CMPRES1, &slow_case); 1488 __ BranchUnsignedGreaterEqual(T3, CMPRES1, &slow_case);
1484 } 1489 }
1485 1490
1486 // Successfully allocated the object, now update top to point to 1491 // Successfully allocated the object, now update top to point to
1487 // next object start and initialize the object. 1492 // next object start and initialize the object.
1488 __ sw(T3, Address(T5)); 1493 __ sw(T3, Address(T5));
1494 if (is_implicit_instance_closure) {
1495 // This closure allocates a context, update allocation stats.
1496 // T3: context size.
1497 __ LoadImmediate(T3, context_size);
1498 // T5: Clobbered.
1499 __ UpdateAllocationStatsWithSize(kContextCid, T3, T5);
1500 }
1501 // The closure allocation is attributed to the signature class.
1502 // T5: Will be clobbered.
1503 __ UpdateAllocationStats(cls.id(), T5);
1489 1504
1490 // T2: new closure object. 1505 // T2: new closure object.
1491 // T4: new context object (only if is_implicit_closure). 1506 // T4: new context object (only if is_implicit_closure).
1492 // Set the tags. 1507 // Set the tags.
1493 uword tags = 0; 1508 uword tags = 0;
1494 tags = RawObject::SizeTag::update(closure_size, tags); 1509 tags = RawObject::SizeTag::update(closure_size, tags);
1495 tags = RawObject::ClassIdTag::update(cls.id(), tags); 1510 tags = RawObject::ClassIdTag::update(cls.id(), tags);
1496 __ LoadImmediate(T0, tags); 1511 __ LoadImmediate(T0, tags);
1497 __ sw(T0, Address(T2, Instance::tags_offset())); 1512 __ sw(T0, Address(T2, Instance::tags_offset()));
1498 1513
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 const Register right = T0; 2412 const Register right = T0;
2398 __ lw(left, Address(SP, 1 * kWordSize)); 2413 __ lw(left, Address(SP, 1 * kWordSize));
2399 __ lw(right, Address(SP, 0 * kWordSize)); 2414 __ lw(right, Address(SP, 0 * kWordSize));
2400 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); 2415 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2);
2401 __ Ret(); 2416 __ Ret();
2402 } 2417 }
2403 2418
2404 } // namespace dart 2419 } // namespace dart
2405 2420
2406 #endif // defined TARGET_ARCH_MIPS 2421 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/stub_code_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698