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

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

Issue 266913010: Refactor 'dart:profiler' UserTag API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 void Intrinsifier::TwoByteString_equality(Assembler* assembler) { 1716 void Intrinsifier::TwoByteString_equality(Assembler* assembler) {
1717 StringEquality(assembler, kTwoByteStringCid); 1717 StringEquality(assembler, kTwoByteStringCid);
1718 } 1718 }
1719 1719
1720 1720
1721 // On stack: user tag (+0). 1721 // On stack: user tag (+0).
1722 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { 1722 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
1723 // R1: Isolate. 1723 // R1: Isolate.
1724 Isolate* isolate = Isolate::Current(); 1724 Isolate* isolate = Isolate::Current();
1725 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 1725 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
1726 // R2: Current user tag.
1727 __ ldr(R2, Address(R1, Isolate::current_tag_offset()));
zra 2014/05/06 15:27:24 Could you load this directly into R0, and get rid
Cutch 2014/05/06 17:00:25 Done.
1726 // R0: UserTag. 1728 // R0: UserTag.
1727 __ ldr(R0, Address(SP, + 0 * kWordSize)); 1729 __ ldr(R0, Address(SP, + 0 * kWordSize));
1728 // Set Isolate::current_tag_. 1730 // Set Isolate::current_tag_.
1729 __ str(R0, Address(R1, Isolate::current_tag_offset())); 1731 __ str(R0, Address(R1, Isolate::current_tag_offset()));
1730 // R0: UserTag's tag. 1732 // R0: UserTag's tag.
1731 __ ldr(R0, FieldAddress(R0, UserTag::tag_offset())); 1733 __ ldr(R0, FieldAddress(R0, UserTag::tag_offset()));
1732 // Set Isolate::user_tag_. 1734 // Set Isolate::user_tag_.
1733 __ str(R0, Address(R1, Isolate::user_tag_offset())); 1735 __ str(R0, Address(R1, Isolate::user_tag_offset()));
1734 // Set return value. 1736 // Set return value.
1735 const int32_t raw_null = reinterpret_cast<int32_t>(Object::null()); 1737 __ mov(R0, ShifterOperand(R2));
1736 __ LoadImmediate(R0, raw_null); 1738 __ Ret();
1739 }
1740
1741
1742 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) {
1743 Isolate* isolate = Isolate::Current();
1744 // Set return value to default tag address.
1745 __ LoadImmediate(R0,
1746 reinterpret_cast<uword>(isolate->object_store()) +
1747 ObjectStore::default_tag_offset());
1748 __ ldr(R0, Address(R0, 0));
1737 __ Ret(); 1749 __ Ret();
1738 } 1750 }
1739 1751
1740 1752
1741 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 1753 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
1742 // R1: Isolate. 1754 // R1: Default tag address.
1743 Isolate* isolate = Isolate::Current(); 1755 Isolate* isolate = Isolate::Current();
1744 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 1756 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
1745 // Set return value to Isolate::current_tag_. 1757 // Set return value to Isolate::current_tag_.
1746 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 1758 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1747 __ Ret(); 1759 __ Ret();
1748 } 1760 }
1749 1761
1750
1751 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) {
1752 // R1: Isolate.
1753 Isolate* isolate = Isolate::Current();
1754 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
1755 // Set return value to Isolate::current_tag_.
1756 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1757 // Clear Isolate::current_tag_.
1758 const int32_t raw_null = reinterpret_cast<int32_t>(UserTag::null());
1759 __ LoadImmediate(R2, raw_null);
1760 __ str(R2, Address(R1, Isolate::current_tag_offset()));
1761 // Clear Isolate::user_tag_.
1762 __ eor(R2, R2, ShifterOperand(R2));
1763 __ str(R2, Address(R1, Isolate::user_tag_offset()));
1764 __ Ret();
1765 }
1766
1767 } // namespace dart 1762 } // namespace dart
1768 1763
1769 #endif // defined TARGET_ARCH_ARM 1764 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698