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

Side by Side Diff: src/jsregexp.h

Issue 1109010: Run string replace regexp with function in C++ code loop. (Closed)
Patch Set: Fix to also work in debug mode. Created 10 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
« no previous file with comments | « no previous file | src/regexp-delay.js » ('j') | src/runtime.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // Direct offset into the lastMatchInfo array. 135 // Direct offset into the lastMatchInfo array.
136 static const int kLastCaptureCountOffset = 136 static const int kLastCaptureCountOffset =
137 FixedArray::kHeaderSize + kLastCaptureCount * kPointerSize; 137 FixedArray::kHeaderSize + kLastCaptureCount * kPointerSize;
138 static const int kLastSubjectOffset = 138 static const int kLastSubjectOffset =
139 FixedArray::kHeaderSize + kLastSubject * kPointerSize; 139 FixedArray::kHeaderSize + kLastSubject * kPointerSize;
140 static const int kLastInputOffset = 140 static const int kLastInputOffset =
141 FixedArray::kHeaderSize + kLastInput * kPointerSize; 141 FixedArray::kHeaderSize + kLastInput * kPointerSize;
142 static const int kFirstCaptureOffset = 142 static const int kFirstCaptureOffset =
143 FixedArray::kHeaderSize + kFirstCapture * kPointerSize; 143 FixedArray::kHeaderSize + kFirstCapture * kPointerSize;
144 144
145 static bool IsAtom(FixedArray* array) {
fschneider 2010/03/25 10:26:06 Is this function ever called?
Lasse Reichstein 2010/03/26 11:18:26 I don't think so. I switched to using JSRegExp::Is
146 Smi* tag = Smi::cast(array->get(JSRegExp::kTagIndex));
147 return tag == Smi::FromInt(JSRegExp::ATOM);
148 }
149
145 // Used to access the lastMatchInfo array. 150 // Used to access the lastMatchInfo array.
146 static int GetCapture(FixedArray* array, int index) { 151 static int GetCapture(FixedArray* array, int index) {
147 return Smi::cast(array->get(index + kFirstCapture))->value(); 152 return Smi::cast(array->get(index + kFirstCapture))->value();
148 } 153 }
149 154
150 static void SetLastCaptureCount(FixedArray* array, int to) { 155 static void SetLastCaptureCount(FixedArray* array, int to) {
151 array->set(kLastCaptureCount, Smi::FromInt(to)); 156 array->set(kLastCaptureCount, Smi::FromInt(to));
152 } 157 }
153 158
154 static void SetLastSubject(FixedArray* array, String* to) { 159 static void SetLastSubject(FixedArray* array, String* to) {
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 int offsets_vector_length_; 1459 int offsets_vector_length_;
1455 static int static_offsets_vector_[kStaticOffsetsVectorSize]; 1460 static int static_offsets_vector_[kStaticOffsetsVectorSize];
1456 1461
1457 friend class ExternalReference; 1462 friend class ExternalReference;
1458 }; 1463 };
1459 1464
1460 1465
1461 } } // namespace v8::internal 1466 } } // namespace v8::internal
1462 1467
1463 #endif // V8_JSREGEXP_H_ 1468 #endif // V8_JSREGEXP_H_
OLDNEW
« no previous file with comments | « no previous file | src/regexp-delay.js » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698