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

Side by Side Diff: runtime/vm/intrinsifier_ia32.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
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 1742
1743 // On stack: user tag (+1), return-address (+0). 1743 // On stack: user tag (+1), return-address (+0).
1744 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) { 1744 void Intrinsifier::UserTag_makeCurrent(Assembler* assembler) {
1745 Isolate* isolate = Isolate::Current(); 1745 Isolate* isolate = Isolate::Current();
1746 const Address current_tag_addr = 1746 const Address current_tag_addr =
1747 Address::Absolute(reinterpret_cast<uword>(isolate) + 1747 Address::Absolute(reinterpret_cast<uword>(isolate) +
1748 Isolate::current_tag_offset()); 1748 Isolate::current_tag_offset());
1749 const Address user_tag_addr = 1749 const Address user_tag_addr =
1750 Address::Absolute(reinterpret_cast<uword>(isolate) + 1750 Address::Absolute(reinterpret_cast<uword>(isolate) +
1751 Isolate::user_tag_offset()); 1751 Isolate::user_tag_offset());
1752 // EAX: Current user tag.
1753 __ movl(EAX, current_tag_addr);
1752 // EAX: UserTag. 1754 // EAX: UserTag.
1753 __ movl(EAX, Address(ESP, + 1 * kWordSize)); 1755 __ movl(EBX, Address(ESP, + 1 * kWordSize));
1754 // Set Isolate::current_tag_. 1756 // Set Isolate::current_tag_.
1755 __ movl(current_tag_addr, EAX); 1757 __ movl(current_tag_addr, EBX);
1756 // EAX: UserTag's tag. 1758 // EAX: UserTag's tag.
1757 __ movl(EAX, FieldAddress(EAX, UserTag::tag_offset())); 1759 __ movl(EBX, FieldAddress(EBX, UserTag::tag_offset()));
1758 // Set Isolate::user_tag_. 1760 // Set Isolate::user_tag_.
1759 __ movl(user_tag_addr, EAX); 1761 __ movl(user_tag_addr, EBX);
1762 __ ret();
1763 }
1764
1765
1766 void Intrinsifier::UserTag_defaultTag(Assembler* assembler) {
1767 Isolate* isolate = Isolate::Current();
1768 const Address default_tag_addr =
1769 Address::Absolute(
1770 reinterpret_cast<uword>(isolate->object_store()) +
1771 ObjectStore::default_tag_offset());
1760 // Set return value. 1772 // Set return value.
1761 const Immediate& raw_null = 1773 __ movl(EAX, default_tag_addr);
1762 Immediate(reinterpret_cast<int32_t>(Object::null()));
1763 __ movl(EAX, raw_null);
1764 __ ret(); 1774 __ ret();
1765 } 1775 }
1766 1776
1767 1777
1768 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 1778 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
1769 Isolate* isolate = Isolate::Current(); 1779 Isolate* isolate = Isolate::Current();
1770 const Address current_tag_addr = 1780 const Address current_tag_addr =
1771 Address::Absolute(reinterpret_cast<uword>(isolate) + 1781 Address::Absolute(reinterpret_cast<uword>(isolate) +
1772 Isolate::current_tag_offset()); 1782 Isolate::current_tag_offset());
1773 // Set return value to Isolate::current_tag_. 1783 // Set return value to Isolate::current_tag_.
1774 __ movl(EAX, current_tag_addr); 1784 __ movl(EAX, current_tag_addr);
1775 __ ret(); 1785 __ ret();
1776 } 1786 }
1777 1787
1778
1779 void Intrinsifier::Profiler_clearCurrentTag(Assembler* assembler) {
1780 Isolate* isolate = Isolate::Current();
1781 const Address current_tag_addr =
1782 Address::Absolute(reinterpret_cast<uword>(isolate) +
1783 Isolate::current_tag_offset());
1784 const Address user_tag_addr =
1785 Address::Absolute(reinterpret_cast<uword>(isolate) +
1786 Isolate::user_tag_offset());
1787 // Set return value to Isolate::current_tag_.
1788 __ movl(EAX, current_tag_addr);
1789 // Clear Isolate::current_tag_.
1790 const Immediate& raw_null =
1791 Immediate(reinterpret_cast<int32_t>(UserTag::null()));
1792 __ movl(current_tag_addr, raw_null);
1793 // Clear Isolate::user_tag_.
1794 __ movl(user_tag_addr, Immediate(0));
1795 __ ret();
1796 }
1797
1798 #undef __ 1788 #undef __
1799 } // namespace dart 1789 } // namespace dart
1800 1790
1801 #endif // defined TARGET_ARCH_IA32 1791 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/intrinsifier_arm64.cc ('k') | runtime/vm/intrinsifier_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698