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

Side by Side Diff: runtime/vm/stub_code_arm.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_ARM) 6 #if defined(TARGET_ARCH_ARM)
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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 __ Ret(); 1148 __ Ret();
1149 } 1149 }
1150 1150
1151 1151
1152 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function 1152 // Called for invoking "dynamic noSuchMethod(Invocation invocation)" function
1153 // from the entry code of a dart function after an error in passed argument 1153 // from the entry code of a dart function after an error in passed argument
1154 // name or number is detected. 1154 // name or number is detected.
1155 // Input parameters: 1155 // Input parameters:
1156 // LR : return address. 1156 // LR : return address.
1157 // SP : address of last argument. 1157 // SP : address of last argument.
1158 // R5: inline cache data object.
1159 // R4: arguments descriptor array. 1158 // R4: arguments descriptor array.
1160 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) { 1159 void StubCode::GenerateCallNoSuchMethodFunctionStub(Assembler* assembler) {
1161 __ EnterStubFrame(); 1160 __ EnterStubFrame();
1162 1161
1163 // Load the receiver. 1162 // Load the receiver.
1164 __ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset())); 1163 __ ldr(R2, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
1165 __ add(IP, FP, Operand(R2, LSL, 1)); // R2 is Smi. 1164 __ add(IP, FP, Operand(R2, LSL, 1)); // R2 is Smi.
1166 __ ldr(R6, Address(IP, kParamEndSlotFromFp * kWordSize)); 1165 __ ldr(R6, Address(IP, kParamEndSlotFromFp * kWordSize));
1167 1166
1168 // Push space for the return value. 1167 // Push space for the return value.
1169 // Push the receiver. 1168 // Push the receiver.
1170 // Push IC data object. 1169 // Push IC data object.
Vyacheslav Egorov (Google) 2014/09/02 22:28:04 comment is obsolete, update
Florian Schneider 2014/09/03 09:05:00 Done.
1171 // Push arguments descriptor array. 1170 // Push arguments descriptor array.
1172 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); 1171 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
1173 __ PushList((1 << R4) | (1 << R5) | (1 << R6) | (1 << IP)); 1172 __ PushList((1 << R4) | (1 << R6) | (1 << IP));
1174 1173
1175 // R2: Smi-tagged arguments array length. 1174 // R2: Smi-tagged arguments array length.
1176 PushArgumentsArray(assembler); 1175 PushArgumentsArray(assembler);
1177 1176
1178 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); 1177 const intptr_t kNumArgs = 3;
Vyacheslav Egorov (Google) 2014/09/02 22:28:04 this 3 is related to the number of bits set in the
Florian Schneider 2014/09/03 09:05:00 It's a little tricky to generate the push-list - m
1178 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, kNumArgs);
1179 // Remove arguments. 1179 // Remove arguments.
1180 __ Drop(4); 1180 __ Drop(kNumArgs);
1181 __ Pop(R0); // Get result into R0. 1181 __ Pop(R0); // Get result into R0.
1182 __ LeaveStubFrame(); 1182 __ LeaveStubFrame();
Vyacheslav Egorov (Google) 2014/09/02 22:28:04 something is off here: three things were pushed an
Florian Schneider 2014/09/03 09:05:00 I'm sure PushArgumentsArray is the missing piece h
1183 __ Ret(); 1183 __ Ret();
1184 } 1184 }
1185 1185
1186 1186
1187 // R6: function object. 1187 // R6: function object.
1188 // R5: inline cache data object. 1188 // R5: inline cache data object.
1189 // Cannot use function object from ICData as it may be the inlined 1189 // Cannot use function object from ICData as it may be the inlined
1190 // function and not the top-scope function. 1190 // function and not the top-scope function.
1191 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) { 1191 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
1192 Register ic_reg = R5; 1192 Register ic_reg = R5;
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 const Register right = R0; 1956 const Register right = R0;
1957 __ ldr(left, Address(SP, 1 * kWordSize)); 1957 __ ldr(left, Address(SP, 1 * kWordSize));
1958 __ ldr(right, Address(SP, 0 * kWordSize)); 1958 __ ldr(right, Address(SP, 0 * kWordSize));
1959 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1959 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1960 __ Ret(); 1960 __ Ret();
1961 } 1961 }
1962 1962
1963 } // namespace dart 1963 } // namespace dart
1964 1964
1965 #endif // defined TARGET_ARCH_ARM 1965 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698