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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 1981002: Refactored custom call IC generators: (Closed)
Patch Set: Review fixes. Created 10 years, 7 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
« no previous file with comments | « no previous file | src/assembler.h » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush), 1114 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPush),
1115 argc + 1, 1115 argc + 1,
1116 1); 1116 1);
1117 1117
1118 // Handle call cache miss. 1118 // Handle call cache miss.
1119 __ bind(&miss); 1119 __ bind(&miss);
1120 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); 1120 Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1121 __ Jump(ic, RelocInfo::CODE_TARGET); 1121 __ Jump(ic, RelocInfo::CODE_TARGET);
1122 1122
1123 // Return the generated code. 1123 // Return the generated code.
1124 String* function_name = NULL; 1124 return GetCode(function);
1125 if (function->shared()->name()->IsString()) {
1126 function_name = String::cast(function->shared()->name());
1127 }
1128 return GetCode(CONSTANT_FUNCTION, function_name);
1129 } 1125 }
1130 1126
1131 1127
1132 Object* CallStubCompiler::CompileArrayPopCall(Object* object, 1128 Object* CallStubCompiler::CompileArrayPopCall(Object* object,
1133 JSObject* holder, 1129 JSObject* holder,
1134 JSFunction* function, 1130 JSFunction* function,
1135 String* name, 1131 String* name,
1136 CheckType check) { 1132 CheckType check) {
1137 // ----------- S t a t e ------------- 1133 // ----------- S t a t e -------------
1138 // -- r2 : name 1134 // -- r2 : name
(...skipping 29 matching lines...) Expand all
1168 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop), 1164 __ TailCallExternalReference(ExternalReference(Builtins::c_ArrayPop),
1169 argc + 1, 1165 argc + 1,
1170 1); 1166 1);
1171 1167
1172 // Handle call cache miss. 1168 // Handle call cache miss.
1173 __ bind(&miss); 1169 __ bind(&miss);
1174 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); 1170 Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1175 __ Jump(ic, RelocInfo::CODE_TARGET); 1171 __ Jump(ic, RelocInfo::CODE_TARGET);
1176 1172
1177 // Return the generated code. 1173 // Return the generated code.
1178 String* function_name = NULL; 1174 return GetCode(function);
1179 if (function->shared()->name()->IsString()) {
1180 function_name = String::cast(function->shared()->name());
1181 }
1182 return GetCode(CONSTANT_FUNCTION, function_name);
1183 } 1175 }
1184 1176
1185 1177
1186 Object* CallStubCompiler::CompileCallConstant(Object* object, 1178 Object* CallStubCompiler::CompileCallConstant(Object* object,
1187 JSObject* holder, 1179 JSObject* holder,
1188 JSFunction* function, 1180 JSFunction* function,
1189 String* name, 1181 String* name,
1190 CheckType check) { 1182 CheckType check) {
1191 // ----------- S t a t e ------------- 1183 // ----------- S t a t e -------------
1192 // -- r2 : name 1184 // -- r2 : name
1193 // -- lr : return address 1185 // -- lr : return address
1194 // ----------------------------------- 1186 // -----------------------------------
1195 SharedFunctionInfo* function_info = function->shared(); 1187 SharedFunctionInfo* function_info = function->shared();
1196 if (function_info->HasCustomCallGenerator()) { 1188 if (function_info->HasCustomCallGenerator()) {
1197 CustomCallGenerator generator = 1189 const int id = function_info->custom_call_generator_id();
1198 ToCData<CustomCallGenerator>(function_info->function_data()); 1190 Object* result =
1199 Object* result = generator(this, object, holder, function, name, check); 1191 CompileCustomCall(id, object, holder, function, name, check);
1200 // undefined means bail out to regular compiler. 1192 // undefined means bail out to regular compiler.
1201 if (!result->IsUndefined()) { 1193 if (!result->IsUndefined()) {
1202 return result; 1194 return result;
1203 } 1195 }
1204 } 1196 }
1205 1197
1206 Label miss_in_smi_check; 1198 Label miss_in_smi_check;
1207 1199
1208 // Get the receiver from the stack 1200 // Get the receiver from the stack
1209 const int argc = arguments().immediate(); 1201 const int argc = arguments().immediate();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 __ bind(&miss); 1319 __ bind(&miss);
1328 if (depth != kInvalidProtoDepth) { 1320 if (depth != kInvalidProtoDepth) {
1329 FreeSpaceForFastApiCall(masm()); 1321 FreeSpaceForFastApiCall(masm());
1330 } 1322 }
1331 1323
1332 __ bind(&miss_in_smi_check); 1324 __ bind(&miss_in_smi_check);
1333 Handle<Code> ic = ComputeCallMiss(arguments().immediate()); 1325 Handle<Code> ic = ComputeCallMiss(arguments().immediate());
1334 __ Jump(ic, RelocInfo::CODE_TARGET); 1326 __ Jump(ic, RelocInfo::CODE_TARGET);
1335 1327
1336 // Return the generated code. 1328 // Return the generated code.
1337 String* function_name = NULL; 1329 return GetCode(function);
1338 if (function->shared()->name()->IsString()) {
1339 function_name = String::cast(function->shared()->name());
1340 }
1341 return GetCode(CONSTANT_FUNCTION, function_name);
1342 } 1330 }
1343 1331
1344 1332
1345 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object, 1333 Object* CallStubCompiler::CompileCallInterceptor(JSObject* object,
1346 JSObject* holder, 1334 JSObject* holder,
1347 String* name) { 1335 String* name) {
1348 // ----------- S t a t e ------------- 1336 // ----------- S t a t e -------------
1349 // -- r2 : name 1337 // -- r2 : name
1350 // -- lr : return address 1338 // -- lr : return address
1351 // ----------------------------------- 1339 // -----------------------------------
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
2171 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); 2159 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET);
2172 2160
2173 // Return the generated code. 2161 // Return the generated code.
2174 return GetCode(); 2162 return GetCode();
2175 } 2163 }
2176 2164
2177 2165
2178 #undef __ 2166 #undef __
2179 2167
2180 } } // namespace v8::internal 2168 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698