OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3796 } | 3796 } |
3797 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3797 code->set_deoptimization_data(empty_fixed_array(), SKIP_WRITE_BARRIER); |
3798 code->InitializeTypeFeedbackInfoNoWriteBarrier(undefined_value()); | 3798 code->InitializeTypeFeedbackInfoNoWriteBarrier(undefined_value()); |
3799 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); | 3799 code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); |
3800 code->set_gc_metadata(Smi::FromInt(0)); | 3800 code->set_gc_metadata(Smi::FromInt(0)); |
3801 code->set_ic_age(global_ic_age_); | 3801 code->set_ic_age(global_ic_age_); |
3802 code->set_prologue_offset(kPrologueOffsetNotSet); | 3802 code->set_prologue_offset(kPrologueOffsetNotSet); |
3803 if (code->kind() == Code::OPTIMIZED_FUNCTION) { | 3803 if (code->kind() == Code::OPTIMIZED_FUNCTION) { |
3804 code->set_marked_for_deoptimization(false); | 3804 code->set_marked_for_deoptimization(false); |
3805 } | 3805 } |
3806 // Allow self references to created code object by patching the handle to | 3806 // Allow self references to created code object by patching the handle to |
Jakob Kummerow
2013/03/19 16:32:05
Let's add another check at this point.
Michael Starzinger
2013/03/19 16:43:54
Done.
| |
3807 // point to the newly allocated Code object. | 3807 // point to the newly allocated Code object. |
3808 if (!self_reference.is_null()) { | 3808 if (!self_reference.is_null()) { |
3809 *(self_reference.location()) = code; | 3809 *(self_reference.location()) = code; |
3810 } | 3810 } |
3811 // Migrate generated code. | 3811 // Migrate generated code. |
3812 // The generated code can contain Object** values (typically from handles) | 3812 // The generated code can contain Object** values (typically from handles) |
3813 // that are dereferenced during the copy to point directly to the actual heap | 3813 // that are dereferenced during the copy to point directly to the actual heap |
3814 // objects. These pointers can include references to the code object itself, | 3814 // objects. These pointers can include references to the code object itself, |
3815 // through the self_reference parameter. | 3815 // through the self_reference parameter. |
3816 CHECK(code->IsCode()); | |
3817 CHECK(code->relocation_info()->IsByteArray()); | |
3816 code->CopyFrom(desc); | 3818 code->CopyFrom(desc); |
3817 | 3819 |
3818 #ifdef VERIFY_HEAP | 3820 #ifdef VERIFY_HEAP |
3819 if (FLAG_verify_heap) { | 3821 if (FLAG_verify_heap) { |
3820 code->Verify(); | 3822 code->Verify(); |
3821 } | 3823 } |
3822 #endif | 3824 #endif |
3823 return code; | 3825 return code; |
3824 } | 3826 } |
3825 | 3827 |
(...skipping 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7814 static_cast<int>(object_sizes_last_time_[index])); | 7816 static_cast<int>(object_sizes_last_time_[index])); |
7815 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7817 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7816 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7818 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7817 | 7819 |
7818 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7820 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7819 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7821 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7820 ClearObjectStats(); | 7822 ClearObjectStats(); |
7821 } | 7823 } |
7822 | 7824 |
7823 } } // namespace v8::internal | 7825 } } // namespace v8::internal |
OLD | NEW |