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

Side by Side Diff: src/ic.cc

Issue 604059: Introduce builtin for Array.slice function. (Closed)
Patch Set: Next round Created 10 years, 10 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/execution.cc ('k') | test/mjsunit/array-slice.js » ('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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 return ReferenceError("not_defined", name); 448 return ReferenceError("not_defined", name);
449 } 449 }
450 return TypeError("undefined_method", object, name); 450 return TypeError("undefined_method", object, name);
451 } 451 }
452 } 452 }
453 453
454 ASSERT(result != Heap::the_hole_value()); 454 ASSERT(result != Heap::the_hole_value());
455 455
456 if (result->IsJSFunction()) { 456 if (result->IsJSFunction()) {
457 // Check if there is an optimized (builtin) version of the function. 457 // Check if there is an optimized (builtin) version of the function.
458 // Ignored this will degrade performance for Array.prototype.{push,pop}. 458 // Ignored this will degrade performance for some Array functions.
459 // Please note we only return the optimized function iff 459 // Please note we only return the optimized function iff
460 // the JSObject has FastElements. 460 // the JSObject has FastElements.
461 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) { 461 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) {
462 Object* opt = Top::LookupSpecialFunction(JSObject::cast(*object), 462 Object* opt = Top::LookupSpecialFunction(JSObject::cast(*object),
463 lookup.holder(), 463 lookup.holder(),
464 JSFunction::cast(result)); 464 JSFunction::cast(result));
465 if (opt->IsJSFunction()) return opt; 465 if (opt->IsJSFunction()) return opt;
466 } 466 }
467 467
468 #ifdef ENABLE_DEBUGGER_SUPPORT 468 #ifdef ENABLE_DEBUGGER_SUPPORT
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 #undef ADDR 1395 #undef ADDR
1396 }; 1396 };
1397 1397
1398 1398
1399 Address IC::AddressFromUtilityId(IC::UtilityId id) { 1399 Address IC::AddressFromUtilityId(IC::UtilityId id) {
1400 return IC_utilities[id]; 1400 return IC_utilities[id];
1401 } 1401 }
1402 1402
1403 1403
1404 } } // namespace v8::internal 1404 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.cc ('k') | test/mjsunit/array-slice.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698