Index: src/heap/mark-compact.cc |
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
index 98ec7152e8c5521dc699908f98026d2ce85f14be..ce15038d9cc83f93cc2b7c3741fe8a78e2119e8f 100644 |
--- a/src/heap/mark-compact.cc |
+++ b/src/heap/mark-compact.cc |
@@ -1462,7 +1462,7 @@ class MarkCompactMarkingVisitor |
static const int kRegExpCodeThreshold = 5; |
static void UpdateRegExpCodeAgeAndFlush(Heap* heap, JSRegExp* re, |
- bool is_ascii) { |
+ bool is_one_byte) { |
// Make sure that the fixed array is in fact initialized on the RegExp. |
// We could potentially trigger a GC when initializing the RegExp. |
if (HeapObject::cast(re->data())->map()->instance_type() != |
@@ -1472,22 +1472,23 @@ class MarkCompactMarkingVisitor |
// Make sure this is a RegExp that actually contains code. |
if (re->TypeTag() != JSRegExp::IRREGEXP) return; |
- Object* code = re->DataAt(JSRegExp::code_index(is_ascii)); |
+ Object* code = re->DataAt(JSRegExp::code_index(is_one_byte)); |
if (!code->IsSmi() && |
HeapObject::cast(code)->map()->instance_type() == CODE_TYPE) { |
// Save a copy that can be reinstated if we need the code again. |
- re->SetDataAt(JSRegExp::saved_code_index(is_ascii), code); |
+ re->SetDataAt(JSRegExp::saved_code_index(is_one_byte), code); |
// Saving a copy might create a pointer into compaction candidate |
// that was not observed by marker. This might happen if JSRegExp data |
// was marked through the compilation cache before marker reached JSRegExp |
// object. |
FixedArray* data = FixedArray::cast(re->data()); |
- Object** slot = data->data_start() + JSRegExp::saved_code_index(is_ascii); |
+ Object** slot = |
+ data->data_start() + JSRegExp::saved_code_index(is_one_byte); |
heap->mark_compact_collector()->RecordSlot(slot, slot, code); |
// Set a number in the 0-255 range to guarantee no smi overflow. |
- re->SetDataAt(JSRegExp::code_index(is_ascii), |
+ re->SetDataAt(JSRegExp::code_index(is_one_byte), |
Smi::FromInt(heap->sweep_generation() & 0xff)); |
} else if (code->IsSmi()) { |
int value = Smi::cast(code)->value(); |
@@ -1499,9 +1500,9 @@ class MarkCompactMarkingVisitor |
// Check if we should flush now. |
if (value == ((heap->sweep_generation() - kRegExpCodeThreshold) & 0xff)) { |
- re->SetDataAt(JSRegExp::code_index(is_ascii), |
+ re->SetDataAt(JSRegExp::code_index(is_one_byte), |
Smi::FromInt(JSRegExp::kUninitializedValue)); |
- re->SetDataAt(JSRegExp::saved_code_index(is_ascii), |
+ re->SetDataAt(JSRegExp::saved_code_index(is_one_byte), |
Smi::FromInt(JSRegExp::kUninitializedValue)); |
} |
} |
@@ -1521,7 +1522,7 @@ class MarkCompactMarkingVisitor |
return; |
} |
JSRegExp* re = reinterpret_cast<JSRegExp*>(object); |
- // Flush code or set age on both ASCII and two byte code. |
+ // Flush code or set age on both one byte and two byte code. |
UpdateRegExpCodeAgeAndFlush(heap, re, true); |
UpdateRegExpCodeAgeAndFlush(heap, re, false); |
// Visit the fields of the RegExp, including the updated FixedArray. |