| 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 4350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4361 return reinterpret_cast<Code*>(READ_FIELD(this, kCodeOffset)); | 4361 return reinterpret_cast<Code*>(READ_FIELD(this, kCodeOffset)); |
| 4362 } | 4362 } |
| 4363 | 4363 |
| 4364 | 4364 |
| 4365 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { | 4365 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { |
| 4366 WRITE_FIELD(this, kCodeOffset, value); | 4366 WRITE_FIELD(this, kCodeOffset, value); |
| 4367 CONDITIONAL_WRITE_BARRIER(value->GetHeap(), this, kCodeOffset, value, mode); | 4367 CONDITIONAL_WRITE_BARRIER(value->GetHeap(), this, kCodeOffset, value, mode); |
| 4368 } | 4368 } |
| 4369 | 4369 |
| 4370 | 4370 |
| 4371 void SharedFunctionInfo::ReplaceCode(Code* value) { |
| 4372 // If the GC metadata field is already used then the function was |
| 4373 // enqueued as a code flushing candidate and we remove it now. |
| 4374 if (code()->gc_metadata() != NULL) { |
| 4375 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); |
| 4376 flusher->EvictCandidate(this); |
| 4377 } |
| 4378 |
| 4379 ASSERT(code()->gc_metadata() == NULL && value->gc_metadata() == NULL); |
| 4380 set_code(value); |
| 4381 } |
| 4382 |
| 4383 |
| 4371 ScopeInfo* SharedFunctionInfo::scope_info() { | 4384 ScopeInfo* SharedFunctionInfo::scope_info() { |
| 4372 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset)); | 4385 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset)); |
| 4373 } | 4386 } |
| 4374 | 4387 |
| 4375 | 4388 |
| 4376 void SharedFunctionInfo::set_scope_info(ScopeInfo* value, | 4389 void SharedFunctionInfo::set_scope_info(ScopeInfo* value, |
| 4377 WriteBarrierMode mode) { | 4390 WriteBarrierMode mode) { |
| 4378 WRITE_FIELD(this, kScopeInfoOffset, reinterpret_cast<Object*>(value)); | 4391 WRITE_FIELD(this, kScopeInfoOffset, reinterpret_cast<Object*>(value)); |
| 4379 CONDITIONAL_WRITE_BARRIER(GetHeap(), | 4392 CONDITIONAL_WRITE_BARRIER(GetHeap(), |
| 4380 this, | 4393 this, |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5767 #undef WRITE_UINT32_FIELD | 5780 #undef WRITE_UINT32_FIELD |
| 5768 #undef READ_SHORT_FIELD | 5781 #undef READ_SHORT_FIELD |
| 5769 #undef WRITE_SHORT_FIELD | 5782 #undef WRITE_SHORT_FIELD |
| 5770 #undef READ_BYTE_FIELD | 5783 #undef READ_BYTE_FIELD |
| 5771 #undef WRITE_BYTE_FIELD | 5784 #undef WRITE_BYTE_FIELD |
| 5772 | 5785 |
| 5773 | 5786 |
| 5774 } } // namespace v8::internal | 5787 } } // namespace v8::internal |
| 5775 | 5788 |
| 5776 #endif // V8_OBJECTS_INL_H_ | 5789 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |