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

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

Issue 143213003: Turn ArrayPush into a stub specialized on the elements kind and argc. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Properly bind label Created 6 years, 11 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 | « src/ia32/stub-cache-ia32.cc ('k') | src/x64/code-stubs-x64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, 1275 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object,
1276 Register actual_closure, 1276 Register actual_closure,
1277 Handle<JSFunction> function) { 1277 Handle<JSFunction> function) {
1278 PatchImplicitReceiver(object); 1278 PatchImplicitReceiver(object);
1279 ParameterCount expected(function); 1279 ParameterCount expected(function);
1280 __ InvokeFunction(actual_closure, expected, arguments(), 1280 __ InvokeFunction(actual_closure, expected, arguments(),
1281 JUMP_FUNCTION, NullCallWrapper()); 1281 JUMP_FUNCTION, NullCallWrapper());
1282 } 1282 }
1283 1283
1284 1284
1285 Handle<Code> CallStubCompiler::CompileArrayPushCall(
1286 Handle<Object> object,
1287 Handle<JSObject> holder,
1288 Handle<Cell> cell,
1289 Handle<JSFunction> function,
1290 Handle<String> name,
1291 Code::StubType type) {
1292 // If object is not an array or is observed or sealed, bail out to regular
1293 // call.
1294 if (!object->IsJSArray() ||
1295 !cell.is_null() ||
1296 Handle<JSArray>::cast(object)->map()->is_observed() ||
1297 !Handle<JSArray>::cast(object)->map()->is_extensible()) {
1298 return Handle<Code>::null();
1299 }
1300
1301 Label miss;
1302
1303 HandlerFrontendHeader(object, holder, name, RECEIVER_MAP_CHECK, &miss);
1304
1305 Handle<Map> map(Handle<JSArray>::cast(object)->map());
1306 ElementsKind elements_kind = map->elements_kind();
1307 const int argc = arguments().immediate();
1308
1309 ArrayPushStub stub(elements_kind, argc);
1310 Handle<Code> code = stub.GetCode(isolate());
1311 StubCompiler::GenerateTailCall(masm(), code);
1312
1313 HandlerFrontendFooter(&miss);
1314
1315 // Return the generated code.
1316 return GetCode(type, name);
1317 }
1318
1319
1285 Handle<Code> CallStubCompiler::CompileCallConstant( 1320 Handle<Code> CallStubCompiler::CompileCallConstant(
1286 Handle<Object> object, 1321 Handle<Object> object,
1287 Handle<JSObject> holder, 1322 Handle<JSObject> holder,
1288 Handle<Name> name, 1323 Handle<Name> name,
1289 CheckType check, 1324 CheckType check,
1290 Handle<JSFunction> function) { 1325 Handle<JSFunction> function) {
1291 if (HasCustomCallGenerator(function)) { 1326 if (HasCustomCallGenerator(function)) {
1292 Handle<Code> code = CompileCustomCall(object, holder, 1327 Handle<Code> code = CompileCustomCall(object, holder,
1293 Handle<Cell>::null(), 1328 Handle<Cell>::null(),
1294 function, Handle<String>::cast(name), 1329 function, Handle<String>::cast(name),
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 Handle<FunctionTemplateInfo>( 2044 Handle<FunctionTemplateInfo>(
2010 FunctionTemplateInfo::cast(signature->receiver())); 2045 FunctionTemplateInfo::cast(signature->receiver()));
2011 } 2046 }
2012 } 2047 }
2013 2048
2014 is_simple_api_call_ = true; 2049 is_simple_api_call_ = true;
2015 } 2050 }
2016 2051
2017 2052
2018 } } // namespace v8::internal 2053 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698