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 7012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7023 return FixedArray::cast(data())->get(index); | 7023 return FixedArray::cast(data())->get(index); |
7024 } | 7024 } |
7025 | 7025 |
7026 | 7026 |
7027 void JSRegExp::SetDataAt(int index, Object* value) { | 7027 void JSRegExp::SetDataAt(int index, Object* value) { |
7028 DCHECK(TypeTag() != NOT_COMPILED); | 7028 DCHECK(TypeTag() != NOT_COMPILED); |
7029 DCHECK(index >= kDataIndex); // Only implementation data can be set this way. | 7029 DCHECK(index >= kDataIndex); // Only implementation data can be set this way. |
7030 FixedArray::cast(data())->set(index, value); | 7030 FixedArray::cast(data())->set(index, value); |
7031 } | 7031 } |
7032 | 7032 |
7033 void JSRegExp::SetLastIndex(int index) { | |
7034 static const int offset = | |
7035 kSize + JSRegExp::kLastIndexFieldIndex * kPointerSize; | |
7036 Smi* value = Smi::FromInt(index); | |
7037 WRITE_FIELD(this, offset, value); | |
7038 } | |
7039 | |
7040 Object* JSRegExp::LastIndex() { | |
7041 static const int offset = | |
7042 kSize + JSRegExp::kLastIndexFieldIndex * kPointerSize; | |
7043 return READ_FIELD(this, offset); | |
7044 } | |
7045 | 7033 |
7046 ElementsKind JSObject::GetElementsKind() { | 7034 ElementsKind JSObject::GetElementsKind() { |
7047 ElementsKind kind = map()->elements_kind(); | 7035 ElementsKind kind = map()->elements_kind(); |
7048 #if VERIFY_HEAP && DEBUG | 7036 #if VERIFY_HEAP && DEBUG |
7049 FixedArrayBase* fixed_array = | 7037 FixedArrayBase* fixed_array = |
7050 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset)); | 7038 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset)); |
7051 | 7039 |
7052 // If a GC was caused while constructing this object, the elements | 7040 // If a GC was caused while constructing this object, the elements |
7053 // pointer may point to a one pointer filler map. | 7041 // pointer may point to a one pointer filler map. |
7054 if (ElementsAreSafeToExamine()) { | 7042 if (ElementsAreSafeToExamine()) { |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8326 #undef WRITE_INT64_FIELD | 8314 #undef WRITE_INT64_FIELD |
8327 #undef READ_BYTE_FIELD | 8315 #undef READ_BYTE_FIELD |
8328 #undef WRITE_BYTE_FIELD | 8316 #undef WRITE_BYTE_FIELD |
8329 #undef NOBARRIER_READ_BYTE_FIELD | 8317 #undef NOBARRIER_READ_BYTE_FIELD |
8330 #undef NOBARRIER_WRITE_BYTE_FIELD | 8318 #undef NOBARRIER_WRITE_BYTE_FIELD |
8331 | 8319 |
8332 } // namespace internal | 8320 } // namespace internal |
8333 } // namespace v8 | 8321 } // namespace v8 |
8334 | 8322 |
8335 #endif // V8_OBJECTS_INL_H_ | 8323 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |