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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)), | 1385 v->VisitPointers(reinterpret_cast<Object**>(FIELD_ADDR(this, start)), |
1386 reinterpret_cast<Object**>(FIELD_ADDR(this, end))); | 1386 reinterpret_cast<Object**>(FIELD_ADDR(this, end))); |
1387 } | 1387 } |
1388 | 1388 |
1389 | 1389 |
1390 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { | 1390 void HeapObject::IteratePointer(ObjectVisitor* v, int offset) { |
1391 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); | 1391 v->VisitPointer(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); |
1392 } | 1392 } |
1393 | 1393 |
1394 | 1394 |
1395 void HeapObject::IterateNextCodeLink(ObjectVisitor* v, int offset) { | |
1396 v->VisitNextCodeLink(reinterpret_cast<Object**>(FIELD_ADDR(this, offset))); | |
1397 } | |
1398 | |
1399 | |
1400 double HeapNumber::value() { | 1395 double HeapNumber::value() { |
1401 return READ_DOUBLE_FIELD(this, kValueOffset); | 1396 return READ_DOUBLE_FIELD(this, kValueOffset); |
1402 } | 1397 } |
1403 | 1398 |
1404 | 1399 |
1405 void HeapNumber::set_value(double value) { | 1400 void HeapNumber::set_value(double value) { |
1406 WRITE_DOUBLE_FIELD(this, kValueOffset, value); | 1401 WRITE_DOUBLE_FIELD(this, kValueOffset, value); |
1407 } | 1402 } |
1408 | 1403 |
1409 | 1404 |
(...skipping 4273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5683 return reinterpret_cast<JSMessageObject*>(obj); | 5678 return reinterpret_cast<JSMessageObject*>(obj); |
5684 } | 5679 } |
5685 | 5680 |
5686 | 5681 |
5687 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) | 5682 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) |
5688 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) | 5683 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) |
5689 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) | 5684 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) |
5690 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) | 5685 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) |
5691 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) | 5686 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) |
5692 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) | 5687 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) |
5693 ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset) | |
5694 | 5688 |
5695 | 5689 |
5696 void Code::WipeOutHeader() { | 5690 void Code::WipeOutHeader() { |
5697 WRITE_FIELD(this, kRelocationInfoOffset, NULL); | 5691 WRITE_FIELD(this, kRelocationInfoOffset, NULL); |
5698 WRITE_FIELD(this, kHandlerTableOffset, NULL); | 5692 WRITE_FIELD(this, kHandlerTableOffset, NULL); |
5699 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); | 5693 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); |
5700 WRITE_FIELD(this, kConstantPoolOffset, NULL); | 5694 WRITE_FIELD(this, kConstantPoolOffset, NULL); |
5701 // Do not wipe out e.g. a minor key. | 5695 // Do not wipe out e.g. a minor key. |
5702 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { | 5696 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { |
5703 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); | 5697 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); |
5704 } | 5698 } |
5705 } | 5699 } |
5706 | 5700 |
5707 | 5701 |
5708 Object* Code::type_feedback_info() { | 5702 Object* Code::type_feedback_info() { |
5709 ASSERT(kind() == FUNCTION); | 5703 ASSERT(kind() == FUNCTION); |
5710 return raw_type_feedback_info(); | 5704 return raw_type_feedback_info(); |
5711 } | 5705 } |
5712 | 5706 |
5713 | 5707 |
5714 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { | 5708 void Code::set_type_feedback_info(Object* value, WriteBarrierMode mode) { |
5715 ASSERT(kind() == FUNCTION); | 5709 ASSERT(kind() == FUNCTION); |
5716 set_raw_type_feedback_info(value, mode); | 5710 set_raw_type_feedback_info(value, mode); |
5717 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, | 5711 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, |
5718 value, mode); | 5712 value, mode); |
5719 } | 5713 } |
5720 | 5714 |
5721 | 5715 |
| 5716 Object* Code::next_code_link() { |
| 5717 CHECK(kind() == OPTIMIZED_FUNCTION); |
| 5718 return raw_type_feedback_info(); |
| 5719 } |
| 5720 |
| 5721 |
| 5722 void Code::set_next_code_link(Object* value, WriteBarrierMode mode) { |
| 5723 CHECK(kind() == OPTIMIZED_FUNCTION); |
| 5724 set_raw_type_feedback_info(value); |
| 5725 CONDITIONAL_WRITE_BARRIER(GetHeap(), this, kTypeFeedbackInfoOffset, |
| 5726 value, mode); |
| 5727 } |
| 5728 |
| 5729 |
5722 int Code::stub_info() { | 5730 int Code::stub_info() { |
5723 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || | 5731 ASSERT(kind() == COMPARE_IC || kind() == COMPARE_NIL_IC || |
5724 kind() == BINARY_OP_IC || kind() == LOAD_IC); | 5732 kind() == BINARY_OP_IC || kind() == LOAD_IC); |
5725 return Smi::cast(raw_type_feedback_info())->value(); | 5733 return Smi::cast(raw_type_feedback_info())->value(); |
5726 } | 5734 } |
5727 | 5735 |
5728 | 5736 |
5729 void Code::set_stub_info(int value) { | 5737 void Code::set_stub_info(int value) { |
5730 ASSERT(kind() == COMPARE_IC || | 5738 ASSERT(kind() == COMPARE_IC || |
5731 kind() == COMPARE_NIL_IC || | 5739 kind() == COMPARE_NIL_IC || |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6750 #undef READ_UINT32_FIELD | 6758 #undef READ_UINT32_FIELD |
6751 #undef WRITE_UINT32_FIELD | 6759 #undef WRITE_UINT32_FIELD |
6752 #undef READ_SHORT_FIELD | 6760 #undef READ_SHORT_FIELD |
6753 #undef WRITE_SHORT_FIELD | 6761 #undef WRITE_SHORT_FIELD |
6754 #undef READ_BYTE_FIELD | 6762 #undef READ_BYTE_FIELD |
6755 #undef WRITE_BYTE_FIELD | 6763 #undef WRITE_BYTE_FIELD |
6756 | 6764 |
6757 } } // namespace v8::internal | 6765 } } // namespace v8::internal |
6758 | 6766 |
6759 #endif // V8_OBJECTS_INL_H_ | 6767 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |