OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // Ignored this will degrade performance for Array.prototype.{push,pop}. | 345 // Ignored this will degrade performance for Array.prototype.{push,pop}. |
346 // Please note we only return the optimized function iff | 346 // Please note we only return the optimized function iff |
347 // the JSObject has FastElements. | 347 // the JSObject has FastElements. |
348 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) { | 348 if (object->IsJSObject() && JSObject::cast(*object)->HasFastElements()) { |
349 Object* opt = Top::LookupSpecialFunction(JSObject::cast(*object), | 349 Object* opt = Top::LookupSpecialFunction(JSObject::cast(*object), |
350 lookup.holder(), | 350 lookup.holder(), |
351 JSFunction::cast(result)); | 351 JSFunction::cast(result)); |
352 if (opt->IsJSFunction()) return opt; | 352 if (opt->IsJSFunction()) return opt; |
353 } | 353 } |
354 | 354 |
355 // If performing debug step into then flood this function with one-shot | 355 // Handle stepping into a function if step into is active. |
356 // break points if it is called from where step into was requested. | 356 if (Debug::StepInActive()) { |
357 if (Debug::StepInActive() && fp() == Debug::step_in_fp()) { | |
358 // Protect the result in a handle as the debugger can allocate and might | 357 // Protect the result in a handle as the debugger can allocate and might |
359 // cause GC. | 358 // cause GC. |
360 HandleScope scope; | 359 HandleScope scope; |
361 Handle<Object> result_handle(result); | 360 Handle<JSFunction> function(JSFunction::cast(result)); |
362 // Don't allow step into functions in the native context. | 361 Debug::HandleStepIn(function, fp(), false); |
363 if (JSFunction::cast(result)->context()->global() != | 362 return *function; |
364 Top::context()->builtins()) { | |
365 Handle<SharedFunctionInfo> shared(JSFunction::cast(result)->shared()); | |
366 Debug::FloodWithOneShot(shared); | |
367 } | |
368 return *result_handle; | |
369 } | 363 } |
370 | 364 |
371 return result; | 365 return result; |
372 } | 366 } |
373 | 367 |
374 // Try to find a suitable function delegate for the object at hand. | 368 // Try to find a suitable function delegate for the object at hand. |
375 result = TryCallAsFunction(result); | 369 result = TryCallAsFunction(result); |
376 return result->IsJSFunction() ? | 370 return result->IsJSFunction() ? |
377 result : TypeError("property_not_function", object, name); | 371 result : TypeError("property_not_function", object, name); |
378 } | 372 } |
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 #undef ADDR | 1194 #undef ADDR |
1201 }; | 1195 }; |
1202 | 1196 |
1203 | 1197 |
1204 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 1198 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
1205 return IC_utilities[id]; | 1199 return IC_utilities[id]; |
1206 } | 1200 } |
1207 | 1201 |
1208 | 1202 |
1209 } } // namespace v8::internal | 1203 } } // namespace v8::internal |
OLD | NEW |