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 13 matching lines...) Expand all Loading... |
24 #include "src/heap/incremental-marking.h" | 24 #include "src/heap/incremental-marking.h" |
25 #include "src/heap/objects-visiting.h" | 25 #include "src/heap/objects-visiting.h" |
26 #include "src/heap/spaces.h" | 26 #include "src/heap/spaces.h" |
27 #include "src/heap/store-buffer.h" | 27 #include "src/heap/store-buffer.h" |
28 #include "src/isolate.h" | 28 #include "src/isolate.h" |
29 #include "src/lookup.h" | 29 #include "src/lookup.h" |
30 #include "src/objects.h" | 30 #include "src/objects.h" |
31 #include "src/property.h" | 31 #include "src/property.h" |
32 #include "src/prototype.h" | 32 #include "src/prototype.h" |
33 #include "src/transitions-inl.h" | 33 #include "src/transitions-inl.h" |
34 #include "src/type-feedback-vector.h" | 34 #include "src/type-feedback-vector-inl.h" |
35 #include "src/v8memory.h" | 35 #include "src/v8memory.h" |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 PropertyDetails::PropertyDetails(Smi* smi) { | 40 PropertyDetails::PropertyDetails(Smi* smi) { |
41 value_ = smi->value(); | 41 value_ = smi->value(); |
42 } | 42 } |
43 | 43 |
44 | 44 |
(...skipping 6946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6991 IsFastDoubleElementsKind(array->GetElementsKind())) || | 6991 IsFastDoubleElementsKind(array->GetElementsKind())) || |
6992 ((storage->map() != array->GetHeap()->fixed_double_array_map()) && | 6992 ((storage->map() != array->GetHeap()->fixed_double_array_map()) && |
6993 (IsFastObjectElementsKind(array->GetElementsKind()) || | 6993 (IsFastObjectElementsKind(array->GetElementsKind()) || |
6994 (IsFastSmiElementsKind(array->GetElementsKind()) && | 6994 (IsFastSmiElementsKind(array->GetElementsKind()) && |
6995 Handle<FixedArray>::cast(storage)->ContainsOnlySmisOrHoles())))); | 6995 Handle<FixedArray>::cast(storage)->ContainsOnlySmisOrHoles())))); |
6996 array->set_elements(*storage); | 6996 array->set_elements(*storage); |
6997 array->set_length(Smi::FromInt(storage->length())); | 6997 array->set_length(Smi::FromInt(storage->length())); |
6998 } | 6998 } |
6999 | 6999 |
7000 | 7000 |
7001 Handle<Object> TypeFeedbackInfo::UninitializedSentinel(Isolate* isolate) { | |
7002 return isolate->factory()->uninitialized_symbol(); | |
7003 } | |
7004 | |
7005 | |
7006 Handle<Object> TypeFeedbackInfo::MegamorphicSentinel(Isolate* isolate) { | |
7007 return isolate->factory()->megamorphic_symbol(); | |
7008 } | |
7009 | |
7010 | |
7011 Handle<Object> TypeFeedbackInfo::PremonomorphicSentinel(Isolate* isolate) { | |
7012 return isolate->factory()->megamorphic_symbol(); | |
7013 } | |
7014 | |
7015 | |
7016 Handle<Object> TypeFeedbackInfo::GenericSentinel(Isolate* isolate) { | |
7017 return isolate->factory()->generic_symbol(); | |
7018 } | |
7019 | |
7020 | |
7021 Handle<Object> TypeFeedbackInfo::MonomorphicArraySentinel(Isolate* isolate, | |
7022 ElementsKind elements_kind) { | |
7023 return Handle<Object>(Smi::FromInt(static_cast<int>(elements_kind)), isolate); | |
7024 } | |
7025 | |
7026 | |
7027 Object* TypeFeedbackInfo::RawUninitializedSentinel(Heap* heap) { | |
7028 return heap->uninitialized_symbol(); | |
7029 } | |
7030 | |
7031 | |
7032 int TypeFeedbackInfo::ic_total_count() { | 7001 int TypeFeedbackInfo::ic_total_count() { |
7033 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); | 7002 int current = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); |
7034 return ICTotalCountField::decode(current); | 7003 return ICTotalCountField::decode(current); |
7035 } | 7004 } |
7036 | 7005 |
7037 | 7006 |
7038 void TypeFeedbackInfo::set_ic_total_count(int count) { | 7007 void TypeFeedbackInfo::set_ic_total_count(int count) { |
7039 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); | 7008 int value = Smi::cast(READ_FIELD(this, kStorage1Offset))->value(); |
7040 value = ICTotalCountField::update(value, | 7009 value = ICTotalCountField::update(value, |
7041 ICTotalCountField::decode(count)); | 7010 ICTotalCountField::decode(count)); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7265 #undef READ_SHORT_FIELD | 7234 #undef READ_SHORT_FIELD |
7266 #undef WRITE_SHORT_FIELD | 7235 #undef WRITE_SHORT_FIELD |
7267 #undef READ_BYTE_FIELD | 7236 #undef READ_BYTE_FIELD |
7268 #undef WRITE_BYTE_FIELD | 7237 #undef WRITE_BYTE_FIELD |
7269 #undef NOBARRIER_READ_BYTE_FIELD | 7238 #undef NOBARRIER_READ_BYTE_FIELD |
7270 #undef NOBARRIER_WRITE_BYTE_FIELD | 7239 #undef NOBARRIER_WRITE_BYTE_FIELD |
7271 | 7240 |
7272 } } // namespace v8::internal | 7241 } } // namespace v8::internal |
7273 | 7242 |
7274 #endif // V8_OBJECTS_INL_H_ | 7243 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |