| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 5452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5463 if (source->IsUndefined()) hash = String::cast(source)->Hash(); | 5463 if (source->IsUndefined()) hash = String::cast(source)->Hash(); |
| 5464 } | 5464 } |
| 5465 hash ^= ComputeIntegerHash(shared()->start_position_and_type()); | 5465 hash ^= ComputeIntegerHash(shared()->start_position_and_type()); |
| 5466 hash += ComputeIntegerHash(shared()->end_position()); | 5466 hash += ComputeIntegerHash(shared()->end_position()); |
| 5467 return hash; | 5467 return hash; |
| 5468 } | 5468 } |
| 5469 | 5469 |
| 5470 | 5470 |
| 5471 bool JSFunction::IsInlineable() { | 5471 bool JSFunction::IsInlineable() { |
| 5472 if (IsBuiltin()) return false; | 5472 if (IsBuiltin()) return false; |
| 5473 SharedFunctionInfo* shared_info = shared(); |
| 5473 // Check that the function has a script associated with it. | 5474 // Check that the function has a script associated with it. |
| 5474 if (!shared()->script()->IsScript()) return false; | 5475 if (!shared_info->script()->IsScript()) return false; |
| 5475 Code* code = shared()->code(); | 5476 if (shared_info->optimization_disabled()) return false; |
| 5477 Code* code = shared_info->code(); |
| 5476 if (code->kind() == Code::OPTIMIZED_FUNCTION) return true; | 5478 if (code->kind() == Code::OPTIMIZED_FUNCTION) return true; |
| 5477 // If we never ran this (unlikely) then lets try to optimize it. | 5479 // If we never ran this (unlikely) then lets try to optimize it. |
| 5478 if (code->kind() != Code::FUNCTION) return true; | 5480 if (code->kind() != Code::FUNCTION) return true; |
| 5479 return code->optimizable(); | 5481 return code->optimizable(); |
| 5480 } | 5482 } |
| 5481 | 5483 |
| 5482 | 5484 |
| 5483 Object* JSFunction::SetInstancePrototype(Object* value) { | 5485 Object* JSFunction::SetInstancePrototype(Object* value) { |
| 5484 ASSERT(value->IsJSObject()); | 5486 ASSERT(value->IsJSObject()); |
| 5485 | 5487 |
| (...skipping 4499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9985 if (break_point_objects()->IsUndefined()) return 0; | 9987 if (break_point_objects()->IsUndefined()) return 0; |
| 9986 // Single beak point. | 9988 // Single beak point. |
| 9987 if (!break_point_objects()->IsFixedArray()) return 1; | 9989 if (!break_point_objects()->IsFixedArray()) return 1; |
| 9988 // Multiple break points. | 9990 // Multiple break points. |
| 9989 return FixedArray::cast(break_point_objects())->length(); | 9991 return FixedArray::cast(break_point_objects())->length(); |
| 9990 } | 9992 } |
| 9991 #endif | 9993 #endif |
| 9992 | 9994 |
| 9993 | 9995 |
| 9994 } } // namespace v8::internal | 9996 } } // namespace v8::internal |
| OLD | NEW |