OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 3548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3559 } | 3559 } |
3560 | 3560 |
3561 | 3561 |
3562 Code* JSFunction::unchecked_code() { | 3562 Code* JSFunction::unchecked_code() { |
3563 return reinterpret_cast<Code*>( | 3563 return reinterpret_cast<Code*>( |
3564 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); | 3564 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); |
3565 } | 3565 } |
3566 | 3566 |
3567 | 3567 |
3568 void JSFunction::set_code(Code* value) { | 3568 void JSFunction::set_code(Code* value) { |
3569 // Skip the write barrier because code is never in new space. | |
3570 ASSERT(!HEAP->InNewSpace(value)); | 3569 ASSERT(!HEAP->InNewSpace(value)); |
3571 Address entry = value->entry(); | 3570 Address entry = value->entry(); |
3572 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); | 3571 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); |
3573 GetHeap()->incremental_marking()->RecordWrite( | 3572 GetHeap()->incremental_marking()->RecordWriteOfCodeEntry( |
3574 this, | 3573 this, |
3575 HeapObject::RawField(this, kCodeEntryOffset), | 3574 HeapObject::RawField(this, kCodeEntryOffset), |
3576 value); | 3575 value); |
3577 } | 3576 } |
3578 | 3577 |
3579 | 3578 |
3580 void JSFunction::ReplaceCode(Code* code) { | 3579 void JSFunction::ReplaceCode(Code* code) { |
3581 bool was_optimized = IsOptimized(); | 3580 bool was_optimized = IsOptimized(); |
3582 bool is_optimized = code->kind() == Code::OPTIMIZED_FUNCTION; | 3581 bool is_optimized = code->kind() == Code::OPTIMIZED_FUNCTION; |
3583 | 3582 |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4474 #undef WRITE_INT_FIELD | 4473 #undef WRITE_INT_FIELD |
4475 #undef READ_SHORT_FIELD | 4474 #undef READ_SHORT_FIELD |
4476 #undef WRITE_SHORT_FIELD | 4475 #undef WRITE_SHORT_FIELD |
4477 #undef READ_BYTE_FIELD | 4476 #undef READ_BYTE_FIELD |
4478 #undef WRITE_BYTE_FIELD | 4477 #undef WRITE_BYTE_FIELD |
4479 | 4478 |
4480 | 4479 |
4481 } } // namespace v8::internal | 4480 } } // namespace v8::internal |
4482 | 4481 |
4483 #endif // V8_OBJECTS_INL_H_ | 4482 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |