| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 1768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1779 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: | 1779 case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
| 1780 case EXTERNAL_INT_ARRAY_TYPE: | 1780 case EXTERNAL_INT_ARRAY_TYPE: |
| 1781 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 1781 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
| 1782 case EXTERNAL_FLOAT_ARRAY_TYPE: | 1782 case EXTERNAL_FLOAT_ARRAY_TYPE: |
| 1783 case EXTERNAL_DOUBLE_ARRAY_TYPE: | 1783 case EXTERNAL_DOUBLE_ARRAY_TYPE: |
| 1784 break; | 1784 break; |
| 1785 case SHARED_FUNCTION_INFO_TYPE: { | 1785 case SHARED_FUNCTION_INFO_TYPE: { |
| 1786 SharedFunctionInfo::BodyDescriptor::IterateBody(this, v); | 1786 SharedFunctionInfo::BodyDescriptor::IterateBody(this, v); |
| 1787 break; | 1787 break; |
| 1788 } | 1788 } |
| 1789 case OPTIMIZED_CODE_ENTRY_TYPE: { |
| 1790 OptimizedCodeEntry::BodyDescriptor::IterateBody(this, v); |
| 1791 break; |
| 1792 } |
| 1789 | 1793 |
| 1790 #define MAKE_STRUCT_CASE(NAME, Name, name) \ | 1794 #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
| 1791 case NAME##_TYPE: | 1795 case NAME##_TYPE: |
| 1792 STRUCT_LIST(MAKE_STRUCT_CASE) | 1796 STRUCT_LIST(MAKE_STRUCT_CASE) |
| 1793 #undef MAKE_STRUCT_CASE | 1797 #undef MAKE_STRUCT_CASE |
| 1794 if (type == ALLOCATION_SITE_TYPE) { | 1798 if (type == ALLOCATION_SITE_TYPE) { |
| 1795 AllocationSite::BodyDescriptor::IterateBody(this, v); | 1799 AllocationSite::BodyDescriptor::IterateBody(this, v); |
| 1796 } else { | 1800 } else { |
| 1797 StructBodyDescriptor::IterateBody(this, object_size, v); | 1801 StructBodyDescriptor::IterateBody(this, object_size, v); |
| 1798 } | 1802 } |
| (...skipping 7665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9464 ASSERT(shrink_by % kEntryLength == 0); | 9468 ASSERT(shrink_by % kEntryLength == 0); |
| 9465 ASSERT(shrink_by <= code_map->length() - kEntriesStart); | 9469 ASSERT(shrink_by <= code_map->length() - kEntriesStart); |
| 9466 // Always trim even when array is cleared because of heap verifier. | 9470 // Always trim even when array is cleared because of heap verifier. |
| 9467 RightTrimFixedArray<FROM_GC>(GetHeap(), code_map, shrink_by); | 9471 RightTrimFixedArray<FROM_GC>(GetHeap(), code_map, shrink_by); |
| 9468 if (code_map->length() == kEntriesStart) { | 9472 if (code_map->length() == kEntriesStart) { |
| 9469 ClearOptimizedCodeMap(); | 9473 ClearOptimizedCodeMap(); |
| 9470 } | 9474 } |
| 9471 } | 9475 } |
| 9472 | 9476 |
| 9473 | 9477 |
| 9478 void OptimizedCodeEntry::Kill() { |
| 9479 set_function(NULL, SKIP_WRITE_BARRIER); |
| 9480 set_code(NULL, SKIP_WRITE_BARRIER); |
| 9481 set_native_context(NULL, SKIP_WRITE_BARRIER); |
| 9482 set_literals(NULL, SKIP_WRITE_BARRIER); |
| 9483 set_cacheable(false); |
| 9484 } |
| 9485 |
| 9486 |
| 9474 bool JSFunction::CompileLazy(Handle<JSFunction> function, | 9487 bool JSFunction::CompileLazy(Handle<JSFunction> function, |
| 9475 ClearExceptionFlag flag) { | 9488 ClearExceptionFlag flag) { |
| 9476 bool result = true; | 9489 bool result = true; |
| 9477 if (function->shared()->is_compiled()) { | 9490 if (function->shared()->is_compiled()) { |
| 9478 function->ReplaceCode(function->shared()->code()); | 9491 function->ReplaceCode(function->shared()->code()); |
| 9479 } else { | 9492 } else { |
| 9480 ASSERT(function->shared()->allows_lazy_compilation()); | 9493 ASSERT(function->shared()->allows_lazy_compilation()); |
| 9481 CompilationInfoWithZone info(function); | 9494 CompilationInfoWithZone info(function); |
| 9482 result = CompileLazyHelper(&info, flag); | 9495 result = CompileLazyHelper(&info, flag); |
| 9483 ASSERT(!result || function->is_compiled()); | 9496 ASSERT(!result || function->is_compiled()); |
| (...skipping 6529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16013 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16026 #define ERROR_MESSAGES_TEXTS(C, T) T, |
| 16014 static const char* error_messages_[] = { | 16027 static const char* error_messages_[] = { |
| 16015 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16028 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
| 16016 }; | 16029 }; |
| 16017 #undef ERROR_MESSAGES_TEXTS | 16030 #undef ERROR_MESSAGES_TEXTS |
| 16018 return error_messages_[reason]; | 16031 return error_messages_[reason]; |
| 16019 } | 16032 } |
| 16020 | 16033 |
| 16021 | 16034 |
| 16022 } } // namespace v8::internal | 16035 } } // namespace v8::internal |
| OLD | NEW |