Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Side by Side Diff: src/heap.cc

Issue 12937004: Add more instrumentation for Code::CopyFrom crasher. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Jakob Kummerow. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3787 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
3807 // point to the newly allocated Code object. 3807 // point to the newly allocated Code object.
3808 CHECK(code->IsCode());
3809 CHECK(code->relocation_info()->IsByteArray());
3808 if (!self_reference.is_null()) { 3810 if (!self_reference.is_null()) {
3809 *(self_reference.location()) = code; 3811 *(self_reference.location()) = code;
3810 } 3812 }
3811 // Migrate generated code. 3813 // Migrate generated code.
3812 // The generated code can contain Object** values (typically from handles) 3814 // The generated code can contain Object** values (typically from handles)
3813 // that are dereferenced during the copy to point directly to the actual heap 3815 // 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, 3816 // objects. These pointers can include references to the code object itself,
3815 // through the self_reference parameter. 3817 // through the self_reference parameter.
3818 CHECK(code->IsCode());
3819 CHECK(code->relocation_info()->IsByteArray());
3816 code->CopyFrom(desc); 3820 code->CopyFrom(desc);
3817 3821
3818 #ifdef VERIFY_HEAP 3822 #ifdef VERIFY_HEAP
3819 if (FLAG_verify_heap) { 3823 if (FLAG_verify_heap) {
3820 code->Verify(); 3824 code->Verify();
3821 } 3825 }
3822 #endif 3826 #endif
3823 return code; 3827 return code;
3824 } 3828 }
3825 3829
(...skipping 3988 matching lines...) Expand 10 before | Expand all | Expand 10 after
7814 static_cast<int>(object_sizes_last_time_[index])); 7818 static_cast<int>(object_sizes_last_time_[index]));
7815 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7819 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7816 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7820 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7817 7821
7818 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7822 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7819 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7823 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7820 ClearObjectStats(); 7824 ClearObjectStats();
7821 } 7825 }
7822 7826
7823 } } // namespace v8::internal 7827 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698