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

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

Issue 11783066: Optimize function at its entry instead of at exit. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/vm_sources.gypi » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/assembler_macros.h" 9 #include "vm/assembler_macros.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 __ PushObject(Symbols::EqualOperator()); // Target's name. 1977 __ PushObject(Symbols::EqualOperator()); // Target's name.
1978 __ pushq(RBX); // ICData 1978 __ pushq(RBX); // ICData
1979 __ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry); 1979 __ CallRuntime(kUpdateICDataTwoArgsRuntimeEntry);
1980 __ Drop(4); 1980 __ Drop(4);
1981 __ LeaveFrame(); 1981 __ LeaveFrame();
1982 1982
1983 __ jmp(&compute_result, Assembler::kNearJump); 1983 __ jmp(&compute_result, Assembler::kNearJump);
1984 } 1984 }
1985 1985
1986 // Calls to the runtime to optimize the given function. 1986 // Calls to the runtime to optimize the given function.
1987 // RDX: function to be reoptimized. 1987 // RDI: function to be reoptimized.
1988 // RAX: result of function being optimized (preserved). 1988 // R10: argument descriptor (preserved).
1989 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) { 1989 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
1990 const Immediate raw_null =
1991 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1990 AssemblerMacros::EnterStubFrame(assembler); 1992 AssemblerMacros::EnterStubFrame(assembler);
1991 __ pushq(RAX); 1993 __ pushq(R10);
1992 __ pushq(RDX); 1994 __ pushq(raw_null); // Setup space on stack for return value.
1995 __ pushq(RDI);
1993 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry); 1996 __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry);
1994 __ popq(RDX); 1997 __ popq(RAX); // Disard argument.
1995 __ popq(RAX); 1998 __ popq(RAX); // Get Code object.
1999 __ popq(R10); // Restore argument descriptor.
2000 __ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
2001 __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
1996 __ LeaveFrame(); 2002 __ LeaveFrame();
1997 __ ret(); 2003 __ jmp(RAX);
2004 __ int3();
1998 } 2005 }
1999 2006
2000 2007
2001 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, 2008 DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
2002 BigintCompare, 2009 BigintCompare,
2003 RawBigint* left, 2010 RawBigint* left,
2004 RawBigint* right); 2011 RawBigint* right);
2005 2012
2006 2013
2007 // Does identical check (object references are equal or not equal) with special 2014 // Does identical check (object references are equal or not equal) with special
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 __ cmpq(left, right); 2076 __ cmpq(left, right);
2070 __ Bind(&done); 2077 __ Bind(&done);
2071 __ popq(right); 2078 __ popq(right);
2072 __ popq(left); 2079 __ popq(left);
2073 __ ret(); 2080 __ ret();
2074 } 2081 }
2075 2082
2076 } // namespace dart 2083 } // namespace dart
2077 2084
2078 #endif // defined TARGET_ARCH_X64 2085 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_ia32.cc ('k') | runtime/vm/vm_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698