| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 6415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6426 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset) | 6426 SMI_ACCESSORS(JSMessageObject, start_position, kStartPositionOffset) |
| 6427 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset) | 6427 SMI_ACCESSORS(JSMessageObject, end_position, kEndPositionOffset) |
| 6428 | 6428 |
| 6429 | 6429 |
| 6430 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) | 6430 INT_ACCESSORS(Code, instruction_size, kInstructionSizeOffset) |
| 6431 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) | 6431 INT_ACCESSORS(Code, prologue_offset, kPrologueOffset) |
| 6432 INT_ACCESSORS(Code, constant_pool_offset, kConstantPoolOffset) | 6432 INT_ACCESSORS(Code, constant_pool_offset, kConstantPoolOffset) |
| 6433 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) | 6433 ACCESSORS(Code, relocation_info, ByteArray, kRelocationInfoOffset) |
| 6434 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) | 6434 ACCESSORS(Code, handler_table, FixedArray, kHandlerTableOffset) |
| 6435 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) | 6435 ACCESSORS(Code, deoptimization_data, FixedArray, kDeoptimizationDataOffset) |
| 6436 ACCESSORS(Code, source_position_table, ByteArray, kSourcePositionTableOffset) |
| 6436 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) | 6437 ACCESSORS(Code, raw_type_feedback_info, Object, kTypeFeedbackInfoOffset) |
| 6437 ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset) | 6438 ACCESSORS(Code, next_code_link, Object, kNextCodeLinkOffset) |
| 6438 | 6439 |
| 6439 | 6440 |
| 6440 void Code::WipeOutHeader() { | 6441 void Code::WipeOutHeader() { |
| 6441 WRITE_FIELD(this, kRelocationInfoOffset, NULL); | 6442 WRITE_FIELD(this, kRelocationInfoOffset, NULL); |
| 6442 WRITE_FIELD(this, kHandlerTableOffset, NULL); | 6443 WRITE_FIELD(this, kHandlerTableOffset, NULL); |
| 6443 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); | 6444 WRITE_FIELD(this, kDeoptimizationDataOffset, NULL); |
| 6445 WRITE_FIELD(this, kSourcePositionTableOffset, NULL); |
| 6444 // Do not wipe out major/minor keys on a code stub or IC | 6446 // Do not wipe out major/minor keys on a code stub or IC |
| 6445 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { | 6447 if (!READ_FIELD(this, kTypeFeedbackInfoOffset)->IsSmi()) { |
| 6446 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); | 6448 WRITE_FIELD(this, kTypeFeedbackInfoOffset, NULL); |
| 6447 } | 6449 } |
| 6448 WRITE_FIELD(this, kNextCodeLinkOffset, NULL); | 6450 WRITE_FIELD(this, kNextCodeLinkOffset, NULL); |
| 6449 WRITE_FIELD(this, kGCMetadataOffset, NULL); | 6451 WRITE_FIELD(this, kGCMetadataOffset, NULL); |
| 6450 } | 6452 } |
| 6451 | 6453 |
| 6452 | 6454 |
| 6453 Object* Code::type_feedback_info() { | 6455 Object* Code::type_feedback_info() { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6493 | 6495 |
| 6494 int Code::body_size() { | 6496 int Code::body_size() { |
| 6495 return RoundUp(instruction_size(), kObjectAlignment); | 6497 return RoundUp(instruction_size(), kObjectAlignment); |
| 6496 } | 6498 } |
| 6497 | 6499 |
| 6498 int Code::SizeIncludingMetadata() { | 6500 int Code::SizeIncludingMetadata() { |
| 6499 int size = CodeSize(); | 6501 int size = CodeSize(); |
| 6500 size += relocation_info()->Size(); | 6502 size += relocation_info()->Size(); |
| 6501 size += deoptimization_data()->Size(); | 6503 size += deoptimization_data()->Size(); |
| 6502 size += handler_table()->Size(); | 6504 size += handler_table()->Size(); |
| 6505 if (kind() == FUNCTION) size += source_position_table()->Size(); |
| 6503 return size; | 6506 return size; |
| 6504 } | 6507 } |
| 6505 | 6508 |
| 6506 ByteArray* Code::unchecked_relocation_info() { | 6509 ByteArray* Code::unchecked_relocation_info() { |
| 6507 return reinterpret_cast<ByteArray*>(READ_FIELD(this, kRelocationInfoOffset)); | 6510 return reinterpret_cast<ByteArray*>(READ_FIELD(this, kRelocationInfoOffset)); |
| 6508 } | 6511 } |
| 6509 | 6512 |
| 6510 | 6513 |
| 6511 byte* Code::relocation_start() { | 6514 byte* Code::relocation_start() { |
| 6512 return unchecked_relocation_info()->GetDataStartAddress(); | 6515 return unchecked_relocation_info()->GetDataStartAddress(); |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7958 #undef WRITE_INT64_FIELD | 7961 #undef WRITE_INT64_FIELD |
| 7959 #undef READ_BYTE_FIELD | 7962 #undef READ_BYTE_FIELD |
| 7960 #undef WRITE_BYTE_FIELD | 7963 #undef WRITE_BYTE_FIELD |
| 7961 #undef NOBARRIER_READ_BYTE_FIELD | 7964 #undef NOBARRIER_READ_BYTE_FIELD |
| 7962 #undef NOBARRIER_WRITE_BYTE_FIELD | 7965 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7963 | 7966 |
| 7964 } // namespace internal | 7967 } // namespace internal |
| 7965 } // namespace v8 | 7968 } // namespace v8 |
| 7966 | 7969 |
| 7967 #endif // V8_OBJECTS_INL_H_ | 7970 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |