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

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

Issue 1189573004: Use object pool for runtime calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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_arm64.cc ('k') | runtime/vm/assembler_mips.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 #ifndef VM_ASSEMBLER_MIPS_H_ 5 #ifndef VM_ASSEMBLER_MIPS_H_
6 #define VM_ASSEMBLER_MIPS_H_ 6 #define VM_ASSEMBLER_MIPS_H_
7 7
8 #ifndef VM_ASSEMBLER_H_ 8 #ifndef VM_ASSEMBLER_H_
9 #error Do not include assembler_mips.h directly; use assembler.h instead. 9 #error Do not include assembler_mips.h directly; use assembler.h instead.
10 #endif 10 #endif
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 void set_use_far_branches(bool b) { 280 void set_use_far_branches(bool b) {
281 ASSERT(buffer_.Size() == 0); 281 ASSERT(buffer_.Size() == 0);
282 use_far_branches_ = b; 282 use_far_branches_ = b;
283 } 283 }
284 284
285 void EnterFrame(); 285 void EnterFrame();
286 void LeaveFrameAndReturn(); 286 void LeaveFrameAndReturn();
287 287
288 // Set up a stub frame so that the stack traversal code can easily identify 288 // Set up a stub frame so that the stack traversal code can easily identify
289 // a stub frame. 289 // a stub frame.
290 void EnterStubFrame(bool load_pp = false); 290 void EnterStubFrame();
291 void LeaveStubFrame(); 291 void LeaveStubFrame();
292 // A separate macro for when a Ret immediately follows, so that we can use 292 // A separate macro for when a Ret immediately follows, so that we can use
293 // the branch delay slot. 293 // the branch delay slot.
294 void LeaveStubFrameAndReturn(Register ra = RA); 294 void LeaveStubFrameAndReturn(Register ra = RA);
295 295
296 // Instruction pattern from entrypoint is used in dart frame prologs 296 // Instruction pattern from entrypoint is used in dart frame prologs
297 // to set up the frame and save a PC which can be used to figure out the 297 // to set up the frame and save a PC which can be used to figure out the
298 // RawInstruction object corresponding to the code running in the frame. 298 // RawInstruction object corresponding to the code running in the frame.
299 // See EnterDartFrame. There are 6 instructions before we know the PC. 299 // See EnterDartFrame. There are 6 instructions before we know the PC.
300 static const intptr_t kEntryPointToPcMarkerOffset = 6 * Instr::kInstrSize; 300 static const intptr_t kEntryPointToPcMarkerOffset = 6 * Instr::kInstrSize;
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 jr(T9); 919 jr(T9);
920 delay_slot_available_ = false; // CodePatcher expects a nop. 920 delay_slot_available_ = false; // CodePatcher expects a nop.
921 } 921 }
922 922
923 void BranchLink(const ExternalLabel* label) { 923 void BranchLink(const ExternalLabel* label) {
924 ASSERT(!in_delay_slot_); 924 ASSERT(!in_delay_slot_);
925 LoadImmediate(T9, label->address()); 925 LoadImmediate(T9, label->address());
926 jalr(T9); 926 jalr(T9);
927 } 927 }
928 928
929 void BranchLinkPatchable(const ExternalLabel* label) { 929 void BranchLink(const ExternalLabel* label, Patchability patchable) {
930 ASSERT(!in_delay_slot_); 930 ASSERT(!in_delay_slot_);
931 const int32_t offset = ObjectPool::element_offset( 931 const int32_t offset = ObjectPool::element_offset(
932 object_pool_wrapper_.FindExternalLabel(label, kPatchable)); 932 object_pool_wrapper_.FindExternalLabel(label, patchable));
933 LoadWordFromPoolOffset(T9, offset - kHeapObjectTag); 933 LoadWordFromPoolOffset(T9, offset - kHeapObjectTag);
934 jalr(T9); 934 jalr(T9);
935 delay_slot_available_ = false; // CodePatcher expects a nop. 935 if (patchable == kPatchable) {
936 delay_slot_available_ = false; // CodePatcher expects a nop.
937 }
938 }
939
940 void BranchLinkPatchable(const ExternalLabel* label) {
941 BranchLink(label, kPatchable);
936 } 942 }
937 943
938 void Drop(intptr_t stack_elements) { 944 void Drop(intptr_t stack_elements) {
939 ASSERT(stack_elements >= 0); 945 ASSERT(stack_elements >= 0);
940 if (stack_elements > 0) { 946 if (stack_elements > 0) {
941 addiu(SP, SP, Immediate(stack_elements * kWordSize)); 947 addiu(SP, SP, Immediate(stack_elements * kWordSize));
942 } 948 }
943 } 949 }
944 950
945 void LoadPoolPointer() { 951 void LoadPoolPointer() {
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
1526 void ReserveAlignedFrameSpace(intptr_t frame_space); 1532 void ReserveAlignedFrameSpace(intptr_t frame_space);
1527 1533
1528 // Create a frame for calling into runtime that preserves all volatile 1534 // Create a frame for calling into runtime that preserves all volatile
1529 // registers. Frame's SP is guaranteed to be correctly aligned and 1535 // registers. Frame's SP is guaranteed to be correctly aligned and
1530 // frame_space bytes are reserved under it. 1536 // frame_space bytes are reserved under it.
1531 void EnterCallRuntimeFrame(intptr_t frame_space); 1537 void EnterCallRuntimeFrame(intptr_t frame_space);
1532 void LeaveCallRuntimeFrame(); 1538 void LeaveCallRuntimeFrame();
1533 1539
1534 void LoadWordFromPoolOffset(Register rd, int32_t offset); 1540 void LoadWordFromPoolOffset(Register rd, int32_t offset);
1535 void LoadObject(Register rd, const Object& object); 1541 void LoadObject(Register rd, const Object& object);
1542 void LoadExternalLabel(Register rd,
1543 const ExternalLabel* label,
1544 Patchability patchable);
1536 void PushObject(const Object& object); 1545 void PushObject(const Object& object);
1537 1546
1538 void LoadIsolate(Register result); 1547 void LoadIsolate(Register result);
1539 1548
1540 void LoadClassId(Register result, Register object); 1549 void LoadClassId(Register result, Register object);
1541 void LoadClassById(Register result, Register class_id); 1550 void LoadClassById(Register result, Register class_id);
1542 void LoadClass(Register result, Register object); 1551 void LoadClass(Register result, Register object);
1543 void LoadTaggedClassIdMayBeSmi(Register result, Register object); 1552 void LoadTaggedClassIdMayBeSmi(Register result, Register object);
1544 1553
1545 void ComputeRange(Register result, 1554 void ComputeRange(Register result,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 Register value, 1749 Register value,
1741 Label* no_update); 1750 Label* no_update);
1742 1751
1743 DISALLOW_ALLOCATION(); 1752 DISALLOW_ALLOCATION();
1744 DISALLOW_COPY_AND_ASSIGN(Assembler); 1753 DISALLOW_COPY_AND_ASSIGN(Assembler);
1745 }; 1754 };
1746 1755
1747 } // namespace dart 1756 } // namespace dart
1748 1757
1749 #endif // VM_ASSEMBLER_MIPS_H_ 1758 #endif // VM_ASSEMBLER_MIPS_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.cc ('k') | runtime/vm/assembler_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698