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

Side by Side Diff: runtime/vm/stub_code_mips.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_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 __ LeaveStubFrameAndReturn(RA); 1292 __ LeaveStubFrameAndReturn(RA);
1293 } 1293 }
1294 1294
1295 1295
1296 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function 1296 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function
1297 // from the entry code of a dart function after an error in passed argument 1297 // from the entry code of a dart function after an error in passed argument
1298 // name or number is detected. 1298 // name or number is detected.
1299 // Input parameters: 1299 // Input parameters:
1300 // RA : return address. 1300 // RA : return address.
1301 // SP : address of last argument. 1301 // SP : address of last argument.
1302 // S5: inline cache data object.
1303 // S4: arguments descriptor array. 1302 // S4: arguments descriptor array.
1304 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { 1303 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
1305 __ EnterStubFrame(); 1304 __ EnterStubFrame();
1306 1305
1307 // Load the receiver. 1306 // Load the receiver.
1308 __ lw(A1, FieldAddress(S4, ArgumentsDescriptor::count_offset())); 1307 __ lw(A1, FieldAddress(S4, ArgumentsDescriptor::count_offset()));
1309 __ sll(TMP, A1, 1); // A1 is a Smi. 1308 __ sll(TMP, A1, 1); // A1 is a Smi.
1310 __ addu(TMP, FP, TMP); 1309 __ addu(TMP, FP, TMP);
1311 __ lw(T6, Address(TMP, kParamEndSlotFromFp * kWordSize)); 1310 __ lw(T6, Address(TMP, kParamEndSlotFromFp * kWordSize));
1312 1311
1313 // Push space for the return value. 1312 // Push space for the return value.
1314 // Push the receiver. 1313 // Push the receiver.
1315 // Push IC data object. 1314 // Push IC data object.
1316 // Push arguments descriptor array. 1315 // Push arguments descriptor array.
1317 __ addiu(SP, SP, Immediate(-4 * kWordSize)); 1316 const intptr_t kNumArgs = 3;
1317 __ addiu(SP, SP, Immediate(-kNumArgs * kWordSize));
1318 __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null())); 1318 __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
1319 __ sw(TMP, Address(SP, 3 * kWordSize)); 1319 __ sw(TMP, Address(SP, 2 * kWordSize));
1320 __ sw(T6, Address(SP, 2 * kWordSize)); 1320 __ sw(T6, Address(SP, 1 * kWordSize));
1321 __ sw(S5, Address(SP, 1 * kWordSize));
1322 __ sw(S4, Address(SP, 0 * kWordSize)); 1321 __ sw(S4, Address(SP, 0 * kWordSize));
1323 1322
1324 // A1: Smi-tagged arguments array length. 1323 // A1: Smi-tagged arguments array length.
1325 PushArgumentsArray(assembler); 1324 PushArgumentsArray(assembler);
1326 1325
1327 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); 1326 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, kNumArgs);
1328 1327
1329 __ lw(V0, Address(SP, 4 * kWordSize)); // Get result into V0. 1328 __ lw(V0, Address(SP, kNumArgs * kWordSize)); // Get result into V0.
1330 __ LeaveStubFrameAndReturn(); 1329 __ LeaveStubFrameAndReturn();
1331 } 1330 }
1332 1331
1333 1332
1334 // T0: function object. 1333 // T0: function object.
1335 // S5: inline cache data object. 1334 // S5: inline cache data object.
1336 // Cannot use function object from ICData as it may be the inlined 1335 // Cannot use function object from ICData as it may be the inlined
1337 // function and not the top-scope function. 1336 // function and not the top-scope function.
1338 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) { 1337 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
1339 __ TraceSimMsg("OptimizedUsageCounterIncrement"); 1338 __ TraceSimMsg("OptimizedUsageCounterIncrement");
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
2208 const Register right = T0; 2207 const Register right = T0;
2209 __ lw(left, Address(SP, 1 * kWordSize)); 2208 __ lw(left, Address(SP, 1 * kWordSize));
2210 __ lw(right, Address(SP, 0 * kWordSize)); 2209 __ lw(right, Address(SP, 0 * kWordSize));
2211 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); 2210 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2);
2212 __ Ret(); 2211 __ Ret();
2213 } 2212 }
2214 2213
2215 } // namespace dart 2214 } // namespace dart
2216 2215
2217 #endif // defined TARGET_ARCH_MIPS 2216 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698