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

Side by Side Diff: runtime/vm/stub_code_ia32.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
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_IA32) 6 #if defined(TARGET_ARCH_IA32)
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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 __ ret(); 1189 __ ret();
1190 } 1190 }
1191 1191
1192 1192
1193 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function 1193 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function
1194 // from the entry code of a dart function after an error in passed argument 1194 // from the entry code of a dart function after an error in passed argument
1195 // name or number is detected. 1195 // name or number is detected.
1196 // Input parameters: 1196 // Input parameters:
1197 // ESP : points to return address. 1197 // ESP : points to return address.
1198 // ESP + 4 : address of last argument. 1198 // ESP + 4 : address of last argument.
1199 // ECX : ic-data.
1200 // EDX : arguments descriptor array. 1199 // EDX : arguments descriptor array.
1201 // Uses EAX, EBX, EDI as temporary registers. 1200 // Uses EAX, EBX, EDI as temporary registers.
1202 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { 1201 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
1203 __ EnterStubFrame(); 1202 __ EnterStubFrame();
1204 1203
1205 // Load the receiver. 1204 // Load the receiver.
1206 __ movl(EDI, FieldAddress(EDX, ArgumentsDescriptor::count_offset())); 1205 __ movl(EDI, FieldAddress(EDX, ArgumentsDescriptor::count_offset()));
1207 __ movl(EAX, Address(EBP, EDI, TIMES_2, kParamEndSlotFromFp * kWordSize)); 1206 __ movl(EAX, Address(EBP, EDI, TIMES_2, kParamEndSlotFromFp * kWordSize));
1208 1207
1209 const Immediate& raw_null = 1208 const Immediate& raw_null =
1210 Immediate(reinterpret_cast<intptr_t>(Object::null())); 1209 Immediate(reinterpret_cast<intptr_t>(Object::null()));
1211 __ pushl(raw_null); // Setup space on stack for result from noSuchMethod. 1210 __ pushl(raw_null); // Setup space on stack for result from noSuchMethod.
1212 __ pushl(EAX); // Receiver. 1211 __ pushl(EAX); // Receiver.
1213 __ pushl(ECX); // IC data array.
1214 __ pushl(EDX); // Arguments descriptor array. 1212 __ pushl(EDX); // Arguments descriptor array.
1215 1213
1216 __ movl(EDX, EDI); 1214 __ movl(EDX, EDI);
1217 // EDX: Smi-tagged arguments array length. 1215 // EDX: Smi-tagged arguments array length.
1218 PushArgumentsArray(assembler); 1216 PushArgumentsArray(assembler);
1219 1217
1220 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); 1218 const intptr_t kNumArgs = 3;
1219 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, kNumArgs);
1221 1220
1222 // Remove arguments. 1221 // Remove arguments.
1223 __ Drop(4); 1222 __ Drop(kNumArgs);
1224 __ popl(EAX); // Get result into EAX. 1223 __ popl(EAX); // Get result into EAX.
1225 1224
1226 // Remove the stub frame as we are about to return. 1225 // Remove the stub frame as we are about to return.
1227 __ LeaveFrame(); 1226 __ LeaveFrame();
1228 __ ret(); 1227 __ ret();
1229 } 1228 }
1230 1229
1231 1230
1232 // Cannot use function object from ICData as it may be the inlined 1231 // Cannot use function object from ICData as it may be the inlined
1233 // function and not the top-scope function. 1232 // function and not the top-scope function.
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
2038 const Register temp = ECX; 2037 const Register temp = ECX;
2039 __ movl(left, Address(ESP, 2 * kWordSize)); 2038 __ movl(left, Address(ESP, 2 * kWordSize));
2040 __ movl(right, Address(ESP, 1 * kWordSize)); 2039 __ movl(right, Address(ESP, 1 * kWordSize));
2041 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2040 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2042 __ ret(); 2041 __ ret();
2043 } 2042 }
2044 2043
2045 } // namespace dart 2044 } // namespace dart
2046 2045
2047 #endif // defined TARGET_ARCH_IA32 2046 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698