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

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
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('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) 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::GenerateCallClosureNoSuchMethodStub(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.
1257 // Push arguments descriptor array. 1255 // Push arguments descriptor array.
1258 __ PushObject(Object::null_object(), PP); 1256 __ PushObject(Object::null_object(), PP);
1259 __ Push(R6); 1257 __ Push(R6);
1260 __ Push(R5);
1261 __ Push(R4); 1258 __ Push(R4);
1262 1259
1263 // R2: Smi-tagged arguments array length. 1260 // R2: Smi-tagged arguments array length.
1264 PushArgumentsArray(assembler); 1261 PushArgumentsArray(assembler);
1265 1262
1266 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); 1263 const intptr_t kNumArgs = 3;
1267 // Remove arguments. 1264 __ CallRuntime(kInvokeClosureNoSuchMethodRuntimeEntry, kNumArgs);
1268 __ Drop(4); 1265 // noSuchMethod on closures always throws an error, so it will never return.
1269 __ Pop(R0); // Get result into R0. 1266 __ brk(0);
1270 __ LeaveStubFrame();
1271 __ ret();
1272 } 1267 }
1273 1268
1274 1269
1275 // R6: function object. 1270 // R6: function object.
1276 // R5: inline cache data object. 1271 // R5: inline cache data object.
1277 // Cannot use function object from ICData as it may be the inlined 1272 // Cannot use function object from ICData as it may be the inlined
1278 // function and not the top-scope function. 1273 // function and not the top-scope function.
1279 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) { 1274 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
1280 Register ic_reg = R5; 1275 Register ic_reg = R5;
1281 Register func_reg = R6; 1276 Register func_reg = R6;
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 const Register right = R0; 2061 const Register right = R0;
2067 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 2062 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
2068 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 2063 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
2069 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 2064 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
2070 __ ret(); 2065 __ ret();
2071 } 2066 }
2072 2067
2073 } // namespace dart 2068 } // namespace dart
2074 2069
2075 #endif // defined TARGET_ARCH_ARM64 2070 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698