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/stub_code_x64.cc

Issue 27802002: Disconnects code objects from infrequently used unoptimized functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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_mips.cc ('k') | tests/standalone/code_collection_test.dart » ('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_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize; 1593 const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
1594 const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize; 1594 const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
1595 __ movq(RAX, Address(R12, target_offset)); 1595 __ movq(RAX, Address(R12, target_offset));
1596 __ addq(Address(R12, count_offset), Immediate(Smi::RawValue(1))); 1596 __ addq(Address(R12, count_offset), Immediate(Smi::RawValue(1)));
1597 __ j(NO_OVERFLOW, &call_target_function, Assembler::kNearJump); 1597 __ j(NO_OVERFLOW, &call_target_function, Assembler::kNearJump);
1598 __ movq(Address(R12, count_offset), 1598 __ movq(Address(R12, count_offset),
1599 Immediate(Smi::RawValue(Smi::kMaxValue))); 1599 Immediate(Smi::RawValue(Smi::kMaxValue)));
1600 1600
1601 __ Bind(&call_target_function); 1601 __ Bind(&call_target_function);
1602 // RAX: Target function. 1602 // RAX: Target function.
1603 __ movq(RAX, FieldAddress(RAX, Function::code_offset())); 1603 Label is_compiled;
1604 __ movq(RAX, FieldAddress(RAX, Code::instructions_offset())); 1604 __ movq(RCX, FieldAddress(RAX, Function::code_offset()));
1605 if (FLAG_collect_code) {
1606 // If code might be GC'd, then EBX might be null. If it is, recompile.
1607 __ CompareObject(RCX, Object::null_object(), PP);
1608 __ j(NOT_EQUAL, &is_compiled, Assembler::kNearJump);
1609 __ EnterStubFrame();
1610 __ pushq(R10); // Preserve arguments descriptor array.
1611 __ pushq(RBX); // Preserve IC data object.
1612 __ pushq(RAX); // Pass function.
1613 __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
1614 __ popq(RAX); // Restore function.
1615 __ popq(RBX); // Restore IC data array.
1616 __ popq(R10); // Restore arguments descriptor array.
1617 __ LeaveFrame();
1618 __ movq(RCX, FieldAddress(RAX, Function::code_offset()));
1619 __ Bind(&is_compiled);
1620 }
1621 __ movq(RAX, FieldAddress(RCX, Code::instructions_offset()));
1605 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag)); 1622 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
1606 __ jmp(RAX); 1623 __ jmp(RAX);
1607 1624
1608 __ Bind(&get_class_id_as_smi); 1625 __ Bind(&get_class_id_as_smi);
1609 Label not_smi; 1626 Label not_smi;
1610 // Test if Smi -> load Smi class for comparison. 1627 // Test if Smi -> load Smi class for comparison.
1611 __ testq(RAX, Immediate(kSmiTagMask)); 1628 __ testq(RAX, Immediate(kSmiTagMask));
1612 __ j(NOT_ZERO, &not_smi, Assembler::kNearJump); 1629 __ j(NOT_ZERO, &not_smi, Assembler::kNearJump);
1613 __ movq(RAX, Immediate(Smi::RawValue(kSmiCid))); 1630 __ movq(RAX, Immediate(Smi::RawValue(kSmiCid)));
1614 __ ret(); 1631 __ ret();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 } 1792 }
1776 1793
1777 1794
1778 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) { 1795 void StubCode::GenerateTwoArgsUnoptimizedStaticCallStub(Assembler* assembler) {
1779 GenerateUsageCounterIncrement(assembler, RCX); 1796 GenerateUsageCounterIncrement(assembler, RCX);
1780 GenerateNArgsCheckInlineCacheStub( 1797 GenerateNArgsCheckInlineCacheStub(
1781 assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry); 1798 assembler, 2, kStaticCallMissHandlerTwoArgsRuntimeEntry);
1782 } 1799 }
1783 1800
1784 1801
1802 // Stub for calling the CompileFunction runtime call.
1803 // RCX: IC-Data.
1804 // RDX: Arguments descriptor.
1805 // RAX: Function.
1806 void StubCode::GenerateCompileFunctionRuntimeCallStub(Assembler* assembler) {
1807 __ EnterStubFrame();
1808 __ pushq(RDX); // Preserve arguments descriptor array.
1809 __ pushq(RCX); // Preserve IC data object.
1810 __ pushq(RAX); // Pass function.
1811 __ CallRuntime(kCompileFunctionRuntimeEntry, 1);
1812 __ popq(RAX); // Restore function.
1813 __ popq(RCX); // Restore IC data array.
1814 __ popq(RDX); // Restore arguments descriptor array.
1815 __ LeaveFrame();
1816 __ ret();
1817 }
1818
1819
1785 // RBX, R10: May contain arguments to runtime stub. 1820 // RBX, R10: May contain arguments to runtime stub.
1786 // TOS(0): return address (Dart code). 1821 // TOS(0): return address (Dart code).
1787 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) { 1822 void StubCode::GenerateBreakpointRuntimeStub(Assembler* assembler) {
1788 __ EnterStubFrame(); 1823 __ EnterStubFrame();
1789 // Preserve runtime args. 1824 // Preserve runtime args.
1790 __ pushq(RBX); 1825 __ pushq(RBX);
1791 __ pushq(R10); 1826 __ pushq(R10);
1792 // Room for result. Debugger stub returns address of the 1827 // Room for result. Debugger stub returns address of the
1793 // unpatched runtime stub. 1828 // unpatched runtime stub.
1794 __ LoadObject(R12, Object::null_object(), PP); 1829 __ LoadObject(R12, Object::null_object(), PP);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
2134 __ movq(right, Address(RSP, 3 * kWordSize)); 2169 __ movq(right, Address(RSP, 3 * kWordSize));
2135 GenerateIdenticalWithNumberCheckStub(assembler, left, right); 2170 GenerateIdenticalWithNumberCheckStub(assembler, left, right);
2136 __ popq(right); 2171 __ popq(right);
2137 __ popq(left); 2172 __ popq(left);
2138 __ ret(); 2173 __ ret();
2139 } 2174 }
2140 2175
2141 } // namespace dart 2176 } // namespace dart
2142 2177
2143 #endif // defined TARGET_ARCH_X64 2178 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | tests/standalone/code_collection_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698