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

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

Issue 2764343004: [regexp] Named capture support for callable replacements (Closed)
Patch Set: Created 3 years, 9 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 6982 matching lines...) Expand 10 before | Expand all | Expand 10 after
6993 } 6993 }
6994 6994
6995 6995
6996 String* JSRegExp::Pattern() { 6996 String* JSRegExp::Pattern() {
6997 DCHECK(this->data()->IsFixedArray()); 6997 DCHECK(this->data()->IsFixedArray());
6998 Object* data = this->data(); 6998 Object* data = this->data();
6999 String* pattern = String::cast(FixedArray::cast(data)->get(kSourceIndex)); 6999 String* pattern = String::cast(FixedArray::cast(data)->get(kSourceIndex));
7000 return pattern; 7000 return pattern;
7001 } 7001 }
7002 7002
7003 Object* JSRegExp::CaptureNameMap() {
7004 DCHECK(this->data()->IsFixedArray());
7005 DCHECK_EQ(TypeTag(), IRREGEXP);
7006 return DataAt(kIrregexpCaptureNameMapIndex);
7007 }
7003 7008
7004 Object* JSRegExp::DataAt(int index) { 7009 Object* JSRegExp::DataAt(int index) {
7005 DCHECK(TypeTag() != NOT_COMPILED); 7010 DCHECK(TypeTag() != NOT_COMPILED);
7006 return FixedArray::cast(data())->get(index); 7011 return FixedArray::cast(data())->get(index);
7007 } 7012 }
7008 7013
7009 7014
7010 void JSRegExp::SetDataAt(int index, Object* value) { 7015 void JSRegExp::SetDataAt(int index, Object* value) {
7011 DCHECK(TypeTag() != NOT_COMPILED); 7016 DCHECK(TypeTag() != NOT_COMPILED);
7012 DCHECK(index >= kDataIndex); // Only implementation data can be set this way. 7017 DCHECK(index >= kDataIndex); // Only implementation data can be set this way.
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after
8276 #undef WRITE_INT64_FIELD 8281 #undef WRITE_INT64_FIELD
8277 #undef READ_BYTE_FIELD 8282 #undef READ_BYTE_FIELD
8278 #undef WRITE_BYTE_FIELD 8283 #undef WRITE_BYTE_FIELD
8279 #undef NOBARRIER_READ_BYTE_FIELD 8284 #undef NOBARRIER_READ_BYTE_FIELD
8280 #undef NOBARRIER_WRITE_BYTE_FIELD 8285 #undef NOBARRIER_WRITE_BYTE_FIELD
8281 8286
8282 } // namespace internal 8287 } // namespace internal
8283 } // namespace v8 8288 } // namespace v8
8284 8289
8285 #endif // V8_OBJECTS_INL_H_ 8290 #endif // V8_OBJECTS_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698