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

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

Issue 2764343004: [regexp] Named capture support for callable replacements (Closed)
Patch Set: Final tweaks Created 3 years, 8 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
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6943 matching lines...) Expand 10 before | Expand all | Expand 10 after
6954 } 6954 }
6955 6955
6956 6956
6957 String* JSRegExp::Pattern() { 6957 String* JSRegExp::Pattern() {
6958 DCHECK(this->data()->IsFixedArray()); 6958 DCHECK(this->data()->IsFixedArray());
6959 Object* data = this->data(); 6959 Object* data = this->data();
6960 String* pattern = String::cast(FixedArray::cast(data)->get(kSourceIndex)); 6960 String* pattern = String::cast(FixedArray::cast(data)->get(kSourceIndex));
6961 return pattern; 6961 return pattern;
6962 } 6962 }
6963 6963
6964 Object* JSRegExp::CaptureNameMap() {
6965 DCHECK(this->data()->IsFixedArray());
6966 DCHECK_EQ(TypeTag(), IRREGEXP);
6967 Object* value = DataAt(kIrregexpCaptureNameMapIndex);
6968 DCHECK_NE(value, Smi::FromInt(JSRegExp::kUninitializedValue));
6969 return value;
6970 }
6964 6971
6965 Object* JSRegExp::DataAt(int index) { 6972 Object* JSRegExp::DataAt(int index) {
6966 DCHECK(TypeTag() != NOT_COMPILED); 6973 DCHECK(TypeTag() != NOT_COMPILED);
6967 return FixedArray::cast(data())->get(index); 6974 return FixedArray::cast(data())->get(index);
6968 } 6975 }
6969 6976
6970 6977
6971 void JSRegExp::SetDataAt(int index, Object* value) { 6978 void JSRegExp::SetDataAt(int index, Object* value) {
6972 DCHECK(TypeTag() != NOT_COMPILED); 6979 DCHECK(TypeTag() != NOT_COMPILED);
6973 DCHECK(index >= kDataIndex); // Only implementation data can be set this way. 6980 DCHECK(index >= kDataIndex); // Only implementation data can be set this way.
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
8239 #undef WRITE_BYTE_FIELD 8246 #undef WRITE_BYTE_FIELD
8240 #undef NOBARRIER_READ_BYTE_FIELD 8247 #undef NOBARRIER_READ_BYTE_FIELD
8241 #undef NOBARRIER_WRITE_BYTE_FIELD 8248 #undef NOBARRIER_WRITE_BYTE_FIELD
8242 8249
8243 } // namespace internal 8250 } // namespace internal
8244 } // namespace v8 8251 } // namespace v8
8245 8252
8246 #include "src/objects/object-macros-undef.h" 8253 #include "src/objects/object-macros-undef.h"
8247 8254
8248 #endif // V8_OBJECTS_INL_H_ 8255 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698