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 6143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6154 Builtins::kCompileOptimizedConcurrent); | 6154 Builtins::kCompileOptimizedConcurrent); |
6155 } | 6155 } |
6156 | 6156 |
6157 | 6157 |
6158 bool JSFunction::IsInOptimizationQueue() { | 6158 bool JSFunction::IsInOptimizationQueue() { |
6159 return code() == GetIsolate()->builtins()->builtin( | 6159 return code() == GetIsolate()->builtins()->builtin( |
6160 Builtins::kInOptimizationQueue); | 6160 Builtins::kInOptimizationQueue); |
6161 } | 6161 } |
6162 | 6162 |
6163 | 6163 |
6164 bool JSFunction::IsInobjectSlackTrackingInProgress() { | 6164 void JSFunction::CompleteInobjectSlackTrackingIfActive() { |
6165 return has_initial_map() && | 6165 if (has_initial_map() && initial_map()->IsInobjectSlackTrackingInProgress()) { |
6166 initial_map()->counter() >= Map::kSlackTrackingCounterEnd; | 6166 initial_map()->CompleteInobjectSlackTracking(); |
| 6167 } |
6167 } | 6168 } |
6168 | 6169 |
6169 | 6170 |
| 6171 bool Map::IsInobjectSlackTrackingInProgress() { |
| 6172 return counter() >= Map::kSlackTrackingCounterEnd; |
| 6173 } |
| 6174 |
| 6175 |
| 6176 void Map::InobjectSlackTrackingStep() { |
| 6177 if (!IsInobjectSlackTrackingInProgress()) return; |
| 6178 int counter = this->counter(); |
| 6179 set_counter(counter - 1); |
| 6180 if (counter == kSlackTrackingCounterEnd) { |
| 6181 CompleteInobjectSlackTracking(); |
| 6182 } |
| 6183 } |
| 6184 |
| 6185 |
6170 Code* JSFunction::code() { | 6186 Code* JSFunction::code() { |
6171 return Code::cast( | 6187 return Code::cast( |
6172 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); | 6188 Code::GetObjectFromEntryAddress(FIELD_ADDR(this, kCodeEntryOffset))); |
6173 } | 6189 } |
6174 | 6190 |
6175 | 6191 |
6176 void JSFunction::set_code(Code* value) { | 6192 void JSFunction::set_code(Code* value) { |
6177 DCHECK(!GetHeap()->InNewSpace(value)); | 6193 DCHECK(!GetHeap()->InNewSpace(value)); |
6178 Address entry = value->entry(); | 6194 Address entry = value->entry(); |
6179 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); | 6195 WRITE_INTPTR_FIELD(this, kCodeEntryOffset, reinterpret_cast<intptr_t>(entry)); |
(...skipping 1676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7856 #undef WRITE_INT64_FIELD | 7872 #undef WRITE_INT64_FIELD |
7857 #undef READ_BYTE_FIELD | 7873 #undef READ_BYTE_FIELD |
7858 #undef WRITE_BYTE_FIELD | 7874 #undef WRITE_BYTE_FIELD |
7859 #undef NOBARRIER_READ_BYTE_FIELD | 7875 #undef NOBARRIER_READ_BYTE_FIELD |
7860 #undef NOBARRIER_WRITE_BYTE_FIELD | 7876 #undef NOBARRIER_WRITE_BYTE_FIELD |
7861 | 7877 |
7862 } // namespace internal | 7878 } // namespace internal |
7863 } // namespace v8 | 7879 } // namespace v8 |
7864 | 7880 |
7865 #endif // V8_OBJECTS_INL_H_ | 7881 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |