| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 ASSERT(reg_index >= 0 && reg_index < kNumSafepointRegisters); | 51 ASSERT(reg_index >= 0 && reg_index < kNumSafepointRegisters); |
| 52 int byte_index = reg_index >> kBitsPerByteLog2; | 52 int byte_index = reg_index >> kBitsPerByteLog2; |
| 53 int bit_index = reg_index & (kBitsPerByte - 1); | 53 int bit_index = reg_index & (kBitsPerByte - 1); |
| 54 return (bits_[byte_index] & (1 << bit_index)) != 0; | 54 return (bits_[byte_index] & (1 << bit_index)) != 0; |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 SafepointTable::SafepointTable(Code* code) { | 58 SafepointTable::SafepointTable(Code* code) { |
| 59 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION); | 59 ASSERT(code->kind() == Code::OPTIMIZED_FUNCTION); |
| 60 code_ = code; | 60 code_ = code; |
| 61 Address header = code->instruction_start() + code->safepoint_table_start(); | 61 Address header = code->instruction_start() + code->safepoint_table_offset(); |
| 62 length_ = Memory::uint32_at(header + kLengthOffset); | 62 length_ = Memory::uint32_at(header + kLengthOffset); |
| 63 entry_size_ = Memory::uint32_at(header + kEntrySizeOffset); | 63 entry_size_ = Memory::uint32_at(header + kEntrySizeOffset); |
| 64 pc_and_deoptimization_indexes_ = header + kHeaderSize; | 64 pc_and_deoptimization_indexes_ = header + kHeaderSize; |
| 65 entries_ = pc_and_deoptimization_indexes_ + | 65 entries_ = pc_and_deoptimization_indexes_ + |
| 66 (length_ * kPcAndDeoptimizationIndexSize); | 66 (length_ * kPcAndDeoptimizationIndexSize); |
| 67 ASSERT(entry_size_ > 0); | 67 ASSERT(entry_size_ > 0); |
| 68 ASSERT_EQ(SafepointEntry::DeoptimizationIndexField::max(), | 68 ASSERT_EQ(SafepointEntry::DeoptimizationIndexField::max(), |
| 69 Safepoint::kNoDeoptimizationIndex); | 69 Safepoint::kNoDeoptimizationIndex); |
| 70 } | 70 } |
| 71 | 71 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 unsigned gap_size = info.pc_after_gap - info.pc; | 224 unsigned gap_size = info.pc_after_gap - info.pc; |
| 225 uint32_t encoding = SafepointEntry::DeoptimizationIndexField::encode(index); | 225 uint32_t encoding = SafepointEntry::DeoptimizationIndexField::encode(index); |
| 226 encoding |= SafepointEntry::GapCodeSizeField::encode(gap_size); | 226 encoding |= SafepointEntry::GapCodeSizeField::encode(gap_size); |
| 227 encoding |= SafepointEntry::ArgumentsField::encode(info.arguments); | 227 encoding |= SafepointEntry::ArgumentsField::encode(info.arguments); |
| 228 encoding |= SafepointEntry::SaveDoublesField::encode(info.has_doubles); | 228 encoding |= SafepointEntry::SaveDoublesField::encode(info.has_doubles); |
| 229 return encoding; | 229 return encoding; |
| 230 } | 230 } |
| 231 | 231 |
| 232 | 232 |
| 233 } } // namespace v8::internal | 233 } } // namespace v8::internal |
| OLD | NEW |