Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Side by Side Diff: src/objects-inl.h

Issue 2394713003: [regexp] Port test, match, and search (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 7013 matching lines...) Expand 10 before | Expand all | Expand 10 after
7024 return FixedArray::cast(data())->get(index); 7024 return FixedArray::cast(data())->get(index);
7025 } 7025 }
7026 7026
7027 7027
7028 void JSRegExp::SetDataAt(int index, Object* value) { 7028 void JSRegExp::SetDataAt(int index, Object* value) {
7029 DCHECK(TypeTag() != NOT_COMPILED); 7029 DCHECK(TypeTag() != NOT_COMPILED);
7030 DCHECK(index >= kDataIndex); // Only implementation data can be set this way. 7030 DCHECK(index >= kDataIndex); // Only implementation data can be set this way.
7031 FixedArray::cast(data())->set(index, value); 7031 FixedArray::cast(data())->set(index, value);
7032 } 7032 }
7033 7033
7034 void JSRegExp::SetLastIndex(int index) {
7035 static const int offset =
7036 kSize + JSRegExp::kLastIndexFieldIndex * kPointerSize;
7037 Smi* value = Smi::FromInt(index);
7038 WRITE_FIELD(this, offset, value);
7039 }
7040
7041 Object* JSRegExp::LastIndex() {
7042 static const int offset =
7043 kSize + JSRegExp::kLastIndexFieldIndex * kPointerSize;
7044 return READ_FIELD(this, offset);
7045 }
7034 7046
7035 ElementsKind JSObject::GetElementsKind() { 7047 ElementsKind JSObject::GetElementsKind() {
7036 ElementsKind kind = map()->elements_kind(); 7048 ElementsKind kind = map()->elements_kind();
7037 #if VERIFY_HEAP && DEBUG 7049 #if VERIFY_HEAP && DEBUG
7038 FixedArrayBase* fixed_array = 7050 FixedArrayBase* fixed_array =
7039 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset)); 7051 reinterpret_cast<FixedArrayBase*>(READ_FIELD(this, kElementsOffset));
7040 7052
7041 // If a GC was caused while constructing this object, the elements 7053 // If a GC was caused while constructing this object, the elements
7042 // pointer may point to a one pointer filler map. 7054 // pointer may point to a one pointer filler map.
7043 if (ElementsAreSafeToExamine()) { 7055 if (ElementsAreSafeToExamine()) {
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
8315 #undef WRITE_INT64_FIELD 8327 #undef WRITE_INT64_FIELD
8316 #undef READ_BYTE_FIELD 8328 #undef READ_BYTE_FIELD
8317 #undef WRITE_BYTE_FIELD 8329 #undef WRITE_BYTE_FIELD
8318 #undef NOBARRIER_READ_BYTE_FIELD 8330 #undef NOBARRIER_READ_BYTE_FIELD
8319 #undef NOBARRIER_WRITE_BYTE_FIELD 8331 #undef NOBARRIER_WRITE_BYTE_FIELD
8320 8332
8321 } // namespace internal 8333 } // namespace internal
8322 } // namespace v8 8334 } // namespace v8
8323 8335
8324 #endif // V8_OBJECTS_INL_H_ 8336 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698