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

Side by Side Diff: src/runtime.cc

Issue 870007: Implement a custom call compiler for Array.pop. (Closed)
Patch Set: Ultimate version Created 10 years, 9 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 | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.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 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 static Object* CompileArrayPushCall(CallStubCompiler* compiler, 1269 static Object* CompileArrayPushCall(CallStubCompiler* compiler,
1270 Object* object, 1270 Object* object,
1271 JSObject* holder, 1271 JSObject* holder,
1272 JSFunction* function, 1272 JSFunction* function,
1273 String* name, 1273 String* name,
1274 StubCompiler::CheckType check) { 1274 StubCompiler::CheckType check) {
1275 return compiler->CompileArrayPushCall(object, holder, function, name, check); 1275 return compiler->CompileArrayPushCall(object, holder, function, name, check);
1276 } 1276 }
1277 1277
1278 1278
1279 static Object* CompileArrayPopCall(CallStubCompiler* compiler,
1280 Object* object,
1281 JSObject* holder,
1282 JSFunction* function,
1283 String* name,
1284 StubCompiler::CheckType check) {
1285 return compiler->CompileArrayPopCall(object, holder, function, name, check);
1286 }
1287
1288
1279 static Object* Runtime_SpecialArrayFunctions(Arguments args) { 1289 static Object* Runtime_SpecialArrayFunctions(Arguments args) {
1280 HandleScope scope; 1290 HandleScope scope;
1281 ASSERT(args.length() == 1); 1291 ASSERT(args.length() == 1);
1282 CONVERT_ARG_CHECKED(JSObject, holder, 0); 1292 CONVERT_ARG_CHECKED(JSObject, holder, 0);
1283 1293
1284 InstallBuiltin(holder, "pop", Builtins::ArrayPop); 1294 InstallBuiltin(holder, "pop", Builtins::ArrayPop, CompileArrayPopCall);
1285 InstallBuiltin(holder, "push", Builtins::ArrayPush, CompileArrayPushCall); 1295 InstallBuiltin(holder, "push", Builtins::ArrayPush, CompileArrayPushCall);
1286 InstallBuiltin(holder, "shift", Builtins::ArrayShift); 1296 InstallBuiltin(holder, "shift", Builtins::ArrayShift);
1287 InstallBuiltin(holder, "unshift", Builtins::ArrayUnshift); 1297 InstallBuiltin(holder, "unshift", Builtins::ArrayUnshift);
1288 InstallBuiltin(holder, "slice", Builtins::ArraySlice); 1298 InstallBuiltin(holder, "slice", Builtins::ArraySlice);
1289 InstallBuiltin(holder, "splice", Builtins::ArraySplice); 1299 InstallBuiltin(holder, "splice", Builtins::ArraySplice);
1290 1300
1291 return *holder; 1301 return *holder;
1292 } 1302 }
1293 1303
1294 1304
(...skipping 7502 matching lines...) Expand 10 before | Expand all | Expand 10 after
8797 } else { 8807 } else {
8798 // Handle last resort GC and make sure to allow future allocations 8808 // Handle last resort GC and make sure to allow future allocations
8799 // to grow the heap without causing GCs (if possible). 8809 // to grow the heap without causing GCs (if possible).
8800 Counters::gc_last_resort_from_js.Increment(); 8810 Counters::gc_last_resort_from_js.Increment();
8801 Heap::CollectAllGarbage(false); 8811 Heap::CollectAllGarbage(false);
8802 } 8812 }
8803 } 8813 }
8804 8814
8805 8815
8806 } } // namespace v8::internal 8816 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/stub-cache-ia32.cc ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698