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

Unified Diff: src/runtime.cc

Issue 42214: Fix GC related crash bug in search-replace. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 1512)
+++ src/runtime.cc (working copy)
@@ -1146,10 +1146,10 @@
StringBuilderSubstringPosition::is_valid(from)) {
int encoded_slice = StringBuilderSubstringLength::encode(length) |
StringBuilderSubstringPosition::encode(from);
- AddElement(Smi::FromInt(encoded_slice));
+ AddElement(Handle<Object>(Smi::FromInt(encoded_slice)));
} else {
Handle<String> slice = Factory::NewStringSlice(subject_, from, to);
- AddElement(*slice);
+ AddElement(slice);
}
IncrementCharacterCount(length);
}
@@ -1160,7 +1160,7 @@
StringShape shape(*string);
int length = string->length(shape);
if (length > 0) {
- AddElement(*string);
+ AddElement(string);
if (!shape.IsAsciiRepresentation()) {
is_ascii_ = false;
}
@@ -1220,7 +1220,7 @@
}
- void AddElement(Object* element) {
+ void AddElement(Handle<Object> element) {
ASSERT(element->IsSmi() || element->IsString());
// Extend parts_ array if necessary.
if (parts_->length() == part_count_) {
@@ -1229,7 +1229,7 @@
parts_->CopyTo(0, *extended_array, 0, part_count_);
parts_ = extended_array;
}
- parts_->set(part_count_, element);
+ parts_->set(part_count_, *element);
part_count_++;
}
@@ -1551,12 +1551,16 @@
do {
ASSERT(last_match_info_handle->HasFastElements());
- FixedArray* match_info_array = last_match_info_handle->elements();
+ int start, end;
+ {
+ AssertNoAllocation a;
+ FixedArray* match_info_array = last_match_info_handle->elements();
- ASSERT_EQ(capture_count * 2 + 2,
- RegExpImpl::GetLastCaptureCount(match_info_array));
- int start = RegExpImpl::GetCapture(match_info_array, 0);
- int end = RegExpImpl::GetCapture(match_info_array, 1);
+ ASSERT_EQ(capture_count * 2 + 2,
+ RegExpImpl::GetLastCaptureCount(match_info_array));
+ start = RegExpImpl::GetCapture(match_info_array, 0);
+ end = RegExpImpl::GetCapture(match_info_array, 1);
+ }
if (prev < start) {
builder.AddSubjectSlice(prev, start);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698