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