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

Side by Side Diff: runtime/vm/stub_code_arm64.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 __ ret(); 1234 __ ret();
1235 } 1235 }
1236 1236
1237 1237
1238 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function 1238 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function
1239 // from the entry code of a dart function after an error in passed argument 1239 // from the entry code of a dart function after an error in passed argument
1240 // name or number is detected. 1240 // name or number is detected.
1241 // Input parameters: 1241 // Input parameters:
1242 // LR : return address. 1242 // LR : return address.
1243 // SP : address of last argument. 1243 // SP : address of last argument.
1244 // R5: inline cache data object.
1245 // R4: arguments descriptor array. 1244 // R4: arguments descriptor array.
1246 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { 1245 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
1247 __ EnterStubFrame(true); 1246 __ EnterStubFrame(true);
1248 1247
1249 // Load the receiver. 1248 // Load the receiver.
1250 __ LoadFieldFromOffset(R2, R4, ArgumentsDescriptor::count_offset(), kNoPP); 1249 __ LoadFieldFromOffset(R2, R4, ArgumentsDescriptor::count_offset(), kNoPP);
1251 __ add(TMP, FP, Operand(R2, LSL, 2)); // R2 is Smi. 1250 __ add(TMP, FP, Operand(R2, LSL, 2)); // R2 is Smi.
1252 __ LoadFromOffset(R6, TMP, kParamEndSlotFromFp * kWordSize, kNoPP); 1251 __ LoadFromOffset(R6, TMP, kParamEndSlotFromFp * kWordSize, kNoPP);
1253 1252
1254 // Push space for the return value. 1253 // Push space for the return value.
1255 // Push the receiver. 1254 // Push the receiver.
1256 // Push IC data object. 1255 // Push IC data object.
Vyacheslav Egorov (Google) 2014/09/02 22:28:04 comment is obsolete.
Florian Schneider 2014/09/03 09:05:00 Done.
1257 // Push arguments descriptor array. 1256 // Push arguments descriptor array.
1258 __ PushObject(Object::null_object(), PP); 1257 __ PushObject(Object::null_object(), PP);
1259 __ Push(R6); 1258 __ Push(R6);
1260 __ Push(R5);
1261 __ Push(R4); 1259 __ Push(R4);
1262 1260
1263 // R2: Smi-tagged arguments array length. 1261 // R2: Smi-tagged arguments array length.
1264 PushArgumentsArray(assembler); 1262 PushArgumentsArray(assembler);
1265 1263
1266 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); 1264 const intptr_t kNumArgs = 3;
1265 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, kNumArgs);
1267 // Remove arguments. 1266 // Remove arguments.
1268 __ Drop(4); 1267 __ Drop(kNumArgs);
1269 __ Pop(R0); // Get result into R0. 1268 __ Pop(R0); // Get result into R0.
Vyacheslav Egorov (Google) 2014/09/02 22:28:04 something is off here with amount of pushed args /
Florian Schneider 2014/09/03 09:05:00 I'm sure PushArgumentsArray is the missing piece h
1270 __ LeaveStubFrame(); 1269 __ LeaveStubFrame();
1271 __ ret(); 1270 __ ret();
1272 } 1271 }
1273 1272
1274 1273
1275 // R6: function object. 1274 // R6: function object.
1276 // R5: inline cache data object. 1275 // R5: inline cache data object.
1277 // Cannot use function object from ICData as it may be the inlined 1276 // Cannot use function object from ICData as it may be the inlined
1278 // function and not the top-scope function. 1277 // function and not the top-scope function.
1279 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) { 1278 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 const Register right = R0; 2065 const Register right = R0;
2067 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 2066 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
2068 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 2067 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
2069 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2068 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2070 __ ret(); 2069 __ ret();
2071 } 2070 }
2072 2071
2073 } // namespace dart 2072 } // namespace dart
2074 2073
2075 #endif // defined TARGET_ARCH_ARM64 2074 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698