| OLD | NEW |
| 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 Loading... |
| 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 | |
| 472 #ifdef ENABLE_DEBUGGER_SUPPORT | 461 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 473 // Handle stepping into a function if step into is active. | 462 // Handle stepping into a function if step into is active. |
| 474 if (Debug::StepInActive()) { | 463 if (Debug::StepInActive()) { |
| 475 // Protect the result in a handle as the debugger can allocate and might | 464 // Protect the result in a handle as the debugger can allocate and might |
| 476 // cause GC. | 465 // cause GC. |
| 477 HandleScope scope; | 466 HandleScope scope; |
| 478 Handle<JSFunction> function(JSFunction::cast(result)); | 467 Handle<JSFunction> function(JSFunction::cast(result)); |
| 479 Debug::HandleStepIn(function, object, fp(), false); | 468 Debug::HandleStepIn(function, object, fp(), false); |
| 480 return *function; | 469 return *function; |
| 481 } | 470 } |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1532 #undef ADDR | 1521 #undef ADDR |
| 1533 }; | 1522 }; |
| 1534 | 1523 |
| 1535 | 1524 |
| 1536 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1525 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
| 1537 return IC_utilities[id]; | 1526 return IC_utilities[id]; |
| 1538 } | 1527 } |
| 1539 | 1528 |
| 1540 | 1529 |
| 1541 } } // namespace v8::internal | 1530 } } // namespace v8::internal |
| OLD | NEW |