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

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

Issue 517383005: VM: Clean up generated code for NoSuchMethod invocation of closures. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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') | no next file » | 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 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 __ ret(); 1166 __ ret();
1167 } 1167 }
1168 1168
1169 1169
1170 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function 1170 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function
1171 // from the entry code of a dart function after an error in passed argument 1171 // from the entry code of a dart function after an error in passed argument
1172 // name or number is detected. 1172 // name or number is detected.
1173 // Input parameters: 1173 // Input parameters:
1174 // RSP : points to return address. 1174 // RSP : points to return address.
1175 // RSP + 8 : address of last argument. 1175 // RSP + 8 : address of last argument.
1176 // RBX : ic-data.
1177 // R10 : arguments descriptor array. 1176 // R10 : arguments descriptor array.
1178 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { 1177 void StubCode::GenerateCallClosureNoSuchMethodStub(Assembler* assembler) {
1179 __ EnterStubFrame(); 1178 __ EnterStubFrame();
1180 1179
1181 // Load the receiver. 1180 // Load the receiver.
1182 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset())); 1181 __ movq(R13, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
1183 __ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize)); 1182 __ movq(RAX, Address(RBP, R13, TIMES_4, kParamEndSlotFromFp * kWordSize));
1184 1183
1185 __ LoadObject(R12, Object::null_object(), PP); 1184 __ LoadObject(R12, Object::null_object(), PP);
1186 __ pushq(R12); // Setup space on stack for result from noSuchMethod. 1185 __ pushq(R12); // Setup space on stack for result from noSuchMethod.
1187 __ pushq(RAX); // Receiver. 1186 __ pushq(RAX); // Receiver.
1188 __ pushq(RBX); // IC data array.
1189 __ pushq(R10); // Arguments descriptor array. 1187 __ pushq(R10); // Arguments descriptor array.
1190 1188
1191 __ movq(R10, R13); // Smi-tagged arguments array length. 1189 __ movq(R10, R13); // Smi-tagged arguments array length.
1192 PushArgumentsArray(assembler); 1190 PushArgumentsArray(assembler);
1193 1191
1194 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); 1192 const intptr_t kNumArgs = 3;
1195 1193 __ CallRuntime(kInvokeClosureNoSuchMethodRuntimeEntry, kNumArgs);
1196 // Remove arguments. 1194 // noSuchMethod on closures always throws an error, so it will never return.
1197 __ Drop(4); 1195 __ int3();
1198 __ popq(RAX); // Get result into RAX.
1199
1200 // Remove the stub frame as we are about to return.
1201 __ LeaveStubFrame();
1202 __ ret();
1203 } 1196 }
1204 1197
1205 1198
1206 // Cannot use function object from ICData as it may be the inlined 1199 // Cannot use function object from ICData as it may be the inlined
1207 // function and not the top-scope function. 1200 // function and not the top-scope function.
1208 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) { 1201 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
1209 Register ic_reg = RBX; 1202 Register ic_reg = RBX;
1210 Register func_reg = RDI; 1203 Register func_reg = RDI;
1211 if (FLAG_trace_optimized_ic_calls) { 1204 if (FLAG_trace_optimized_ic_calls) {
1212 __ EnterStubFrame(); 1205 __ EnterStubFrame();
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 2009
2017 __ movq(left, Address(RSP, 2 * kWordSize)); 2010 __ movq(left, Address(RSP, 2 * kWordSize));
2018 __ movq(right, Address(RSP, 1 * kWordSize)); 2011 __ movq(right, Address(RSP, 1 * kWordSize));
2019 GenerateIdenticalWithNumberCheckStub(assembler, left, right); 2012 GenerateIdenticalWithNumberCheckStub(assembler, left, right);
2020 __ ret(); 2013 __ ret();
2021 } 2014 }
2022 2015
2023 } // namespace dart 2016 } // namespace dart
2024 2017
2025 #endif // defined TARGET_ARCH_X64 2018 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698