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 5180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5191 Handle<Object> TypeFeedbackCells::MegamorphicSentinel(Isolate* isolate) { | 5191 Handle<Object> TypeFeedbackCells::MegamorphicSentinel(Isolate* isolate) { |
5192 return isolate->factory()->undefined_value(); | 5192 return isolate->factory()->undefined_value(); |
5193 } | 5193 } |
5194 | 5194 |
5195 | 5195 |
5196 Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) { | 5196 Object* TypeFeedbackCells::RawUninitializedSentinel(Heap* heap) { |
5197 return heap->raw_unchecked_the_hole_value(); | 5197 return heap->raw_unchecked_the_hole_value(); |
5198 } | 5198 } |
5199 | 5199 |
5200 | 5200 |
5201 SMI_ACCESSORS(TypeFeedbackInfo, ic_total_count, kIcTotalCountOffset) | 5201 int TypeFeedbackInfo::ic_total_count() { |
5202 SMI_ACCESSORS(TypeFeedbackInfo, ic_with_type_info_count, | 5202 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); |
5203 kIcWithTypeinfoCountOffset) | 5203 return ICTotalCountField::decode(current); |
| 5204 } |
| 5205 |
| 5206 |
| 5207 void TypeFeedbackInfo::set_ic_total_count(int count) { |
| 5208 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); |
| 5209 value = ICTotalCountField::update(value, |
| 5210 ICTotalCountField::decode(count)); |
| 5211 WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(value)); |
| 5212 } |
| 5213 |
| 5214 |
| 5215 int TypeFeedbackInfo::ic_with_type_info_count() { |
| 5216 int current = Smi::cast(READ_FIELD(this, kStorage2Offset))->value(); |
| 5217 return ICsWithTypeInfoCountField::decode(current); |
| 5218 } |
| 5219 |
| 5220 |
| 5221 void TypeFeedbackInfo::change_ic_with_type_info_count(int delta) { |
| 5222 int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value(); |
| 5223 int current_count = ICsWithTypeInfoCountField::decode(value); |
| 5224 value = |
| 5225 ICsWithTypeInfoCountField::update(value, current_count + delta); |
| 5226 WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(value)); |
| 5227 } |
| 5228 |
| 5229 |
| 5230 void TypeFeedbackInfo::initialize_storage() { |
| 5231 WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(0)); |
| 5232 WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(0)); |
| 5233 } |
| 5234 |
| 5235 |
| 5236 void TypeFeedbackInfo::change_own_type_change_checksum() { |
| 5237 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); |
| 5238 int checksum = OwnTypeChangeChecksum::decode(value); |
| 5239 checksum = (checksum + 1) % (1 << kTypeChangeChecksumBits); |
| 5240 value = OwnTypeChangeChecksum::update(value, checksum); |
| 5241 // Ensure packed bit field is in Smi range. |
| 5242 if (value > Smi::kMaxValue) value |= Smi::kMinValue; |
| 5243 if (value < Smi::kMinValue) value &= ~Smi::kMinValue; |
| 5244 WRITE_FIELD(this, kStorage1Offset, Smi::FromInt(value)); |
| 5245 } |
| 5246 |
| 5247 |
| 5248 void TypeFeedbackInfo::set_inlined_type_change_checksum(int checksum) { |
| 5249 int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value(); |
| 5250 int mask = (1 << kTypeChangeChecksumBits) - 1; |
| 5251 value = InlinedTypeChangeChecksum::update(value, checksum & mask); |
| 5252 // Ensure packed bit field is in Smi range. |
| 5253 if (value > Smi::kMaxValue) value |= Smi::kMinValue; |
| 5254 if (value < Smi::kMinValue) value &= ~Smi::kMinValue; |
| 5255 WRITE_FIELD(this, kStorage2Offset, Smi::FromInt(value)); |
| 5256 } |
| 5257 |
| 5258 |
| 5259 int TypeFeedbackInfo::own_type_change_checksum() { |
| 5260 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); |
| 5261 return OwnTypeChangeChecksum::decode(value); |
| 5262 } |
| 5263 |
| 5264 |
| 5265 bool TypeFeedbackInfo::matches_inlined_type_change_checksum(int checksum) { |
| 5266 int value = Smi::cast(READ_FIELD(this, kStorage2Offset))->value(); |
| 5267 int mask = (1 << kTypeChangeChecksumBits) - 1; |
| 5268 return InlinedTypeChangeChecksum::decode(value) == (checksum & mask); |
| 5269 } |
| 5270 |
| 5271 |
5204 ACCESSORS(TypeFeedbackInfo, type_feedback_cells, TypeFeedbackCells, | 5272 ACCESSORS(TypeFeedbackInfo, type_feedback_cells, TypeFeedbackCells, |
5205 kTypeFeedbackCellsOffset) | 5273 kTypeFeedbackCellsOffset) |
5206 | 5274 |
5207 | 5275 |
5208 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot) | 5276 SMI_ACCESSORS(AliasedArgumentsEntry, aliased_context_slot, kAliasedContextSlot) |
5209 | 5277 |
5210 | 5278 |
5211 Relocatable::Relocatable(Isolate* isolate) { | 5279 Relocatable::Relocatable(Isolate* isolate) { |
5212 ASSERT(isolate == Isolate::Current()); | 5280 ASSERT(isolate == Isolate::Current()); |
5213 isolate_ = isolate; | 5281 isolate_ = isolate; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5312 #undef WRITE_UINT32_FIELD | 5380 #undef WRITE_UINT32_FIELD |
5313 #undef READ_SHORT_FIELD | 5381 #undef READ_SHORT_FIELD |
5314 #undef WRITE_SHORT_FIELD | 5382 #undef WRITE_SHORT_FIELD |
5315 #undef READ_BYTE_FIELD | 5383 #undef READ_BYTE_FIELD |
5316 #undef WRITE_BYTE_FIELD | 5384 #undef WRITE_BYTE_FIELD |
5317 | 5385 |
5318 | 5386 |
5319 } } // namespace v8::internal | 5387 } } // namespace v8::internal |
5320 | 5388 |
5321 #endif // V8_OBJECTS_INL_H_ | 5389 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |