| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 ASSERT(!info->shared_info()->is_compiled()); | 688 ASSERT(!info->shared_info()->is_compiled()); |
| 689 bool result = Compiler::CompileLazy(info); | 689 bool result = Compiler::CompileLazy(info); |
| 690 ASSERT(result != Top::has_pending_exception()); | 690 ASSERT(result != Top::has_pending_exception()); |
| 691 if (!result && flag == CLEAR_EXCEPTION) Top::clear_pending_exception(); | 691 if (!result && flag == CLEAR_EXCEPTION) Top::clear_pending_exception(); |
| 692 return result; | 692 return result; |
| 693 } | 693 } |
| 694 | 694 |
| 695 | 695 |
| 696 bool CompileLazyShared(Handle<SharedFunctionInfo> shared, | 696 bool CompileLazyShared(Handle<SharedFunctionInfo> shared, |
| 697 ClearExceptionFlag flag) { | 697 ClearExceptionFlag flag) { |
| 698 CompilationInfo info(shared, Handle<Object>::null(), 0); | 698 CompilationInfo info(shared); |
| 699 return CompileLazyHelper(&info, flag); | 699 return CompileLazyHelper(&info, flag); |
| 700 } | 700 } |
| 701 | 701 |
| 702 | 702 |
| 703 bool CompileLazy(Handle<JSFunction> function, | 703 bool CompileLazy(Handle<JSFunction> function, |
| 704 Handle<Object> receiver, | 704 Handle<Object> receiver, |
| 705 ClearExceptionFlag flag) { | 705 ClearExceptionFlag flag) { |
| 706 Handle<SharedFunctionInfo> shared(function->shared()); | 706 CompilationInfo info(function, 0, receiver); |
| 707 CompilationInfo info(shared, receiver, 0); | |
| 708 bool result = CompileLazyHelper(&info, flag); | 707 bool result = CompileLazyHelper(&info, flag); |
| 709 LOG(FunctionCreateEvent(*function)); | 708 LOG(FunctionCreateEvent(*function)); |
| 710 return result; | 709 return result; |
| 711 } | 710 } |
| 712 | 711 |
| 713 | 712 |
| 714 bool CompileLazyInLoop(Handle<JSFunction> function, | 713 bool CompileLazyInLoop(Handle<JSFunction> function, |
| 715 Handle<Object> receiver, | 714 Handle<Object> receiver, |
| 716 ClearExceptionFlag flag) { | 715 ClearExceptionFlag flag) { |
| 717 Handle<SharedFunctionInfo> shared(function->shared()); | 716 CompilationInfo info(function, 1, receiver); |
| 718 CompilationInfo info(shared, receiver, 1); | |
| 719 bool result = CompileLazyHelper(&info, flag); | 717 bool result = CompileLazyHelper(&info, flag); |
| 720 LOG(FunctionCreateEvent(*function)); | 718 LOG(FunctionCreateEvent(*function)); |
| 721 return result; | 719 return result; |
| 722 } | 720 } |
| 723 | 721 |
| 724 | 722 |
| 725 OptimizedObjectForAddingMultipleProperties:: | 723 OptimizedObjectForAddingMultipleProperties:: |
| 726 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, | 724 OptimizedObjectForAddingMultipleProperties(Handle<JSObject> object, |
| 727 int expected_additional_properties, | 725 int expected_additional_properties, |
| 728 bool condition) { | 726 bool condition) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 750 | 748 |
| 751 OptimizedObjectForAddingMultipleProperties:: | 749 OptimizedObjectForAddingMultipleProperties:: |
| 752 ~OptimizedObjectForAddingMultipleProperties() { | 750 ~OptimizedObjectForAddingMultipleProperties() { |
| 753 // Reoptimize the object to allow fast property access. | 751 // Reoptimize the object to allow fast property access. |
| 754 if (has_been_transformed_) { | 752 if (has_been_transformed_) { |
| 755 TransformToFastProperties(object_, unused_property_fields_); | 753 TransformToFastProperties(object_, unused_property_fields_); |
| 756 } | 754 } |
| 757 } | 755 } |
| 758 | 756 |
| 759 } } // namespace v8::internal | 757 } } // namespace v8::internal |
| OLD | NEW |