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

Side by Side Diff: src/ic.cc

Issue 819001: Revert change to always call builtins for Array functions.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: 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 | Annotate | Revision Log
« 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 if (IsContextual(object)) { 451 if (IsContextual(object)) {
452 return ReferenceError("not_defined", name); 452 return ReferenceError("not_defined", name);
453 } 453 }
454 return TypeError("undefined_method", object, name); 454 return TypeError("undefined_method", object, name);
455 } 455 }
456 } 456 }
457 457
458 ASSERT(result != Heap::the_hole_value()); 458 ASSERT(result != Heap::the_hole_value());
459 459
460 if (result->IsJSFunction()) { 460 if (result->IsJSFunction()) {
461 // Check if there is an optimized (builtin) version of the function.
462 // Ignored this will degrade performance for some Array functions.
463 // Please note we only return the optimized function iff
464 // the JSObject has FastElements.
465 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) {
466 Object* opt = Top::LookupSpecialFunction(JSObject::cast(*object),
467 lookup.holder(),
468 JSFunction::cast(result));
469 if (opt->IsJSFunction()) return opt;
470 }
471
461 #ifdef ENABLE_DEBUGGER_SUPPORT 472 #ifdef ENABLE_DEBUGGER_SUPPORT
462 // Handle stepping into a function if step into is active. 473 // Handle stepping into a function if step into is active.
463 if (Debug::StepInActive()) { 474 if (Debug::StepInActive()) {
464 // Protect the result in a handle as the debugger can allocate and might 475 // Protect the result in a handle as the debugger can allocate and might
465 // cause GC. 476 // cause GC.
466 HandleScope scope; 477 HandleScope scope;
467 Handle<JSFunction> function(JSFunction::cast(result)); 478 Handle<JSFunction> function(JSFunction::cast(result));
468 Debug::HandleStepIn(function, object, fp(), false); 479 Debug::HandleStepIn(function, object, fp(), false);
469 return *function; 480 return *function;
470 } 481 }
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 #undef ADDR 1532 #undef ADDR
1522 }; 1533 };
1523 1534
1524 1535
1525 Address IC::AddressFromUtilityId(IC::UtilityId id) { 1536 Address IC::AddressFromUtilityId(IC::UtilityId id) {
1526 return IC_utilities[id]; 1537 return IC_utilities[id];
1527 } 1538 }
1528 1539
1529 1540
1530 } } // namespace v8::internal 1541 } } // 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