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

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
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_arm64.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) 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::GenerateCallClosureNoSuchMethodStub(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.
1171 // Push arguments descriptor array. 1169 // Push arguments descriptor array.
1172 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); 1170 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
1173 __ PushList((1 << R4) | (1 << R5) | (1 << R6) | (1 << IP)); 1171 __ PushList((1 << R4) | (1 << R6) | (1 << IP));
1174 1172
1175 // R2: Smi-tagged arguments array length. 1173 // R2: Smi-tagged arguments array length.
1176 PushArgumentsArray(assembler); 1174 PushArgumentsArray(assembler);
1177 1175
1178 __ CallRuntime(kInvokeNoSuchMethodFunctionRuntimeEntry, 4); 1176 const intptr_t kNumArgs = 3;
1179 // Remove arguments. 1177 __ CallRuntime(kInvokeClosureNoSuchMethodRuntimeEntry, kNumArgs);
1180 __ Drop(4); 1178 // noSuchMethod on closures always throws an error, so it will never return.
1181 __ Pop(R0); // Get result into R0. 1179 __ bkpt(0);
1182 __ LeaveStubFrame();
1183 __ Ret();
1184 } 1180 }
1185 1181
1186 1182
1187 // R6: function object. 1183 // R6: function object.
1188 // R5: inline cache data object. 1184 // R5: inline cache data object.
1189 // Cannot use function object from ICData as it may be the inlined 1185 // Cannot use function object from ICData as it may be the inlined
1190 // function and not the top-scope function. 1186 // function and not the top-scope function.
1191 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) { 1187 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
1192 Register ic_reg = R5; 1188 Register ic_reg = R5;
1193 Register func_reg = R6; 1189 Register func_reg = R6;
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
1956 const Register right = R0; 1952 const Register right = R0;
1957 __ ldr(left, Address(SP, 1 * kWordSize)); 1953 __ ldr(left, Address(SP, 1 * kWordSize));
1958 __ ldr(right, Address(SP, 0 * kWordSize)); 1954 __ ldr(right, Address(SP, 0 * kWordSize));
1959 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1955 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1960 __ Ret(); 1956 __ Ret();
1961 } 1957 }
1962 1958
1963 } // namespace dart 1959 } // namespace dart
1964 1960
1965 #endif // defined TARGET_ARCH_ARM 1961 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698