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

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

Issue 181833004: 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: Fix test 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 1367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)), 1378 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)),
1379 reinterpret_cast<Object**>(FIELD_ADDR(this, end))); 1379 reinterpret_cast<Object**>(FIELD_ADDR(this, end)));
1380 } 1380 }
1381 1381
1382 1382
1383 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { 1383 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) {
1384 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); 1384 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset)));
1385 } 1385 }
1386 1386
1387 1387
1388 void HeapObject::IterateNextCodeLink(ObjectVisitor* v, int offset) {
1389 v->VisitNextCodeLink(reinterpret_cast<Object**>(FIELD_ADDR(this, offset)));
1390 }
1391
1392
1388 double HeapNumber::value() { 1393 double HeapNumber::value() {
1389 return READ_DOUBLE_FIELD(this, kValueOffset); 1394 return READ_DOUBLE_FIELD(this, kValueOffset);
1390 } 1395 }
1391 1396
1392 1397
1393 void HeapNumber::set_value(double value) { 1398 void HeapNumber::set_value(double value) {
1394 WRITE_DOUBLE_FIELD(this, kValueOffset, value); 1399 WRITE_DOUBLE_FIELD(this, kValueOffset, value);
1395 } 1400 }
1396 1401
1397 1402
(...skipping 4257 matching lines...) Expand 10 before | Expand all | Expand 10 after
5655 return reinterpret_cast<JSMessageObject*>(obj); 5660 return reinterpret_cast<JSMessageObject*>(obj);
5656 } 5661 }
5657 5662
5658 5663
5659 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) 5664 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset)
5660 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) 5665 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset)
5661 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) 5666 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset)
5662 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) 5667 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset)
5663 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) 5668 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset)
5664 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) 5669 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset)
5670 ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset)
5665 5671
5666 5672
5667 void Code::WipeOutHeader() { 5673 void Code::WipeOutHeader() {
5668 WRITE_FIELD(this, kRelocationInfoOffset, NULL); 5674 WRITE_FIELD(this, kRelocationInfoOffset, NULL);
5669 WRITE_FIELD(this, kHandlerTableOffset, NULL); 5675 WRITE_FIELD(this, kHandlerTableOffset, NULL);
5670 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); 5676 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL);
5671 // Do not wipe out e.g. a minor key. 5677 // Do not wipe out e.g. a minor key.
5672 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { 5678 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) {
5673 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); 5679 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL);
5674 } 5680 }
5675 } 5681 }
5676 5682
5677 5683
5678 Object* Code::type_feedback_info() { 5684 Object* Code::type_feedback_info() {
5679 ASSERT(kind() == FUNCTION); 5685 ASSERT(kind() == FUNCTION);
5680 return raw_type_feedback_info(); 5686 return raw_type_feedback_info();
5681 } 5687 }
5682 5688
5683 5689
5684 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { 5690 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) {
5685 ASSERT(kind() == FUNCTION); 5691 ASSERT(kind() == FUNCTION);
5686 set_raw_type_feedback_info(value, mode); 5692 set_raw_type_feedback_info(value, mode);
5687 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, 5693 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset,
5688 value, mode); 5694 value, mode);
5689 } 5695 }
5690 5696
5691 5697
5692 Object* Code::next_code_link() {
5693 CHECK(kind() == OPTIMIZED_FUNCTION);
5694 return raw_type_feedback_info();
5695 }
5696
5697
5698 void Code::set_next_code_link(Object* value, WriteBarrierMode mode) {
5699 CHECK(kind() == OPTIMIZED_FUNCTION);
5700 set_raw_type_feedback_info(value);
5701 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset,
5702 value, mode);
5703 }
5704
5705
5706 int Code::stub_info() { 5698 int Code::stub_info() {
5707 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || 5699 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC ||
5708 kind() == BINARY_OP_IC || kind() == LOAD_IC); 5700 kind() == BINARY_OP_IC || kind() == LOAD_IC);
5709 return Smi::cast(raw_type_feedback_info())->value(); 5701 return Smi::cast(raw_type_feedback_info())->value();
5710 } 5702 }
5711 5703
5712 5704
5713 void Code::set_stub_info(int value) { 5705 void Code::set_stub_info(int value) {
5714 ASSERT(kind() == COMPARE_IC || 5706 ASSERT(kind() == COMPARE_IC ||
5715 kind() == COMPARE_NIL_IC || 5707 kind() == COMPARE_NIL_IC ||
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
6733 #undef READ_UINT32_FIELD 6725 #undef READ_UINT32_FIELD
6734 #undef WRITE_UINT32_FIELD 6726 #undef WRITE_UINT32_FIELD
6735 #undef READ_SHORT_FIELD 6727 #undef READ_SHORT_FIELD
6736 #undef WRITE_SHORT_FIELD 6728 #undef WRITE_SHORT_FIELD
6737 #undef READ_BYTE_FIELD 6729 #undef READ_BYTE_FIELD
6738 #undef WRITE_BYTE_FIELD 6730 #undef WRITE_BYTE_FIELD
6739 6731
6740 } } // namespace v8::internal 6732 } } // namespace v8::internal
6741 6733
6742 #endif // V8_OBJECTS_INL_H_ 6734 #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