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

Side by Side Diff: src/objects-inl.h

Issue 212553003: Reland r19897 "Fix memory leak caused by treating Code::next_code_link as strong in marker. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/objects.h ('k') | src/objects-visiting.h » ('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 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)), 1386 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)),
1387 reinterpret_cast<Object**>(FIELD_ADDR(this, end))); 1387 reinterpret_cast<Object**>(FIELD_ADDR(this, end)));
1388 } 1388 }
1389 1389
1390 1390
1391 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { 1391 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) {
1392 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); 1392 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset)));
1393 } 1393 }
1394 1394
1395 1395
1396 void HeapObject::IterateNextCodeLink(ObjectVisitor* v, int offset) {
1397 v->VisitNextCodeLink(reinterpret_cast<Object**>(FIELD_ADDR(this, offset)));
1398 }
1399
1400
1396 double HeapNumber::value() { 1401 double HeapNumber::value() {
1397 return READ_DOUBLE_FIELD(this, kValueOffset); 1402 return READ_DOUBLE_FIELD(this, kValueOffset);
1398 } 1403 }
1399 1404
1400 1405
1401 void HeapNumber::set_value(double value) { 1406 void HeapNumber::set_value(double value) {
1402 WRITE_DOUBLE_FIELD(this, kValueOffset, value); 1407 WRITE_DOUBLE_FIELD(this, kValueOffset, value);
1403 } 1408 }
1404 1409
1405 1410
(...skipping 4299 matching lines...) Expand 10 before | Expand all | Expand 10 after
5705 return reinterpret_cast<JSMessageObject*>(obj); 5710 return reinterpret_cast<JSMessageObject*>(obj);
5706 } 5711 }
5707 5712
5708 5713
5709 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) 5714 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset)
5710 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) 5715 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset)
5711 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) 5716 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset)
5712 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) 5717 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset)
5713 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) 5718 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset)
5714 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) 5719 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset)
5720 ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset)
5715 5721
5716 5722
5717 void Code::WipeOutHeader() { 5723 void Code::WipeOutHeader() {
5718 WRITE_FIELD(this, kRelocationInfoOffset, NULL); 5724 WRITE_FIELD(this, kRelocationInfoOffset, NULL);
5719 WRITE_FIELD(this, kHandlerTableOffset, NULL); 5725 WRITE_FIELD(this, kHandlerTableOffset, NULL);
5720 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); 5726 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL);
5721 WRITE_FIELD(this, kConstantPoolOffset, NULL); 5727 WRITE_FIELD(this, kConstantPoolOffset, NULL);
5722 // Do not wipe out e.g. a minor key. 5728 // Do not wipe out e.g. a minor key.
5723 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { 5729 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) {
5724 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); 5730 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL);
5725 } 5731 }
5726 } 5732 }
5727 5733
5728 5734
5729 Object* Code::type_feedback_info() { 5735 Object* Code::type_feedback_info() {
5730 ASSERT(kind() == FUNCTION); 5736 ASSERT(kind() == FUNCTION);
5731 return raw_type_feedback_info(); 5737 return raw_type_feedback_info();
5732 } 5738 }
5733 5739
5734 5740
5735 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { 5741 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) {
5736 ASSERT(kind() == FUNCTION); 5742 ASSERT(kind() == FUNCTION);
5737 set_raw_type_feedback_info(value, mode); 5743 set_raw_type_feedback_info(value, mode);
5738 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, 5744 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset,
5739 value, mode); 5745 value, mode);
5740 } 5746 }
5741 5747
5742 5748
5743 Object* Code::next_code_link() {
5744 CHECK(kind() == OPTIMIZED_FUNCTION);
5745 return raw_type_feedback_info();
5746 }
5747
5748
5749 void Code::set_next_code_link(Object* value, WriteBarrierMode mode) {
5750 CHECK(kind() == OPTIMIZED_FUNCTION);
5751 set_raw_type_feedback_info(value);
5752 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset,
5753 value, mode);
5754 }
5755
5756
5757 int Code::stub_info() { 5749 int Code::stub_info() {
5758 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || 5750 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC ||
5759 kind() == BINARY_OP_IC || kind() == LOAD_IC); 5751 kind() == BINARY_OP_IC || kind() == LOAD_IC);
5760 return Smi::cast(raw_type_feedback_info())->value(); 5752 return Smi::cast(raw_type_feedback_info())->value();
5761 } 5753 }
5762 5754
5763 5755
5764 void Code::set_stub_info(int value) { 5756 void Code::set_stub_info(int value) {
5765 ASSERT(kind() == COMPARE_IC || 5757 ASSERT(kind() == COMPARE_IC ||
5766 kind() == COMPARE_NIL_IC || 5758 kind() == COMPARE_NIL_IC ||
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
6789 #undef READ_UINT32_FIELD 6781 #undef READ_UINT32_FIELD
6790 #undef WRITE_UINT32_FIELD 6782 #undef WRITE_UINT32_FIELD
6791 #undef READ_SHORT_FIELD 6783 #undef READ_SHORT_FIELD
6792 #undef WRITE_SHORT_FIELD 6784 #undef WRITE_SHORT_FIELD
6793 #undef READ_BYTE_FIELD 6785 #undef READ_BYTE_FIELD
6794 #undef WRITE_BYTE_FIELD 6786 #undef WRITE_BYTE_FIELD
6795 6787
6796 } } // namespace v8::internal 6788 } } // namespace v8::internal
6797 6789
6798 #endif // V8_OBJECTS_INL_H_ 6790 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698