Commit 318a09ea authored by oth's avatar oth Committed by Commit bot

[interpreter] Unbreak test262 tests using constants.

Fixes a bug in the constant pool padding calculation.

BUG=v8:4680
LOG=N

Review URL: https://codereview.chromium.org/1749853002

Cr-Commit-Position: refs/heads/master@{#34403}
parent adfea6af
......@@ -87,6 +87,7 @@ Handle<Object> ConstantArrayBuilder::At(size_t index) const {
if (index < slice->start_index() + slice->size()) {
return slice->At(index);
} else {
DCHECK_LT(index, slice->capacity());
return isolate_->factory()->the_hole_value();
}
}
......@@ -99,6 +100,8 @@ Handle<FixedArray> ConstantArrayBuilder::ToFixedArray() {
if (array_index == fixed_array->length()) {
break;
}
DCHECK(array_index == 0 ||
base::bits::IsPowerOfTwo32(static_cast<uint32_t>(array_index)));
// Copy objects from slice into array.
for (size_t i = 0; i < slice->size(); ++i) {
fixed_array->set(array_index++, *slice->At(slice->start_index() + i));
......@@ -107,8 +110,7 @@ Handle<FixedArray> ConstantArrayBuilder::ToFixedArray() {
size_t padding =
std::min(static_cast<size_t>(fixed_array->length() - array_index),
slice->capacity() - slice->size());
for (size_t i = slice->start_index() + slice->size();
i < slice->start_index() + padding; ++i) {
for (size_t i = 0; i < padding; i++) {
fixed_array->set(array_index++, *isolate_->factory()->the_hole_value());
}
}
......
......@@ -634,18 +634,6 @@
'language/statements/generators/yield-newline': [FAIL],
'language/statements/generators/yield-star-before-newline': [FAIL],
# TODO(4680,oth): Failing on DCHECK_EQ(array_index, fixed_array->length()) in constant-array-builder.cc.
'language/expressions/left-shift/S11.7.1_A4_T1': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/left-shift/S11.7.1_A4_T2': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/right-shift/S11.7.2_A4_T2': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/right-shift/S11.7.2_A4_T1': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/right-shift/S11.7.2_A4_T3': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/right-shift/S11.7.2_A4_T4': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/unsigned-right-shift/S11.7.3_A4_T2': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/unsigned-right-shift/S11.7.3_A4_T3': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/unsigned-right-shift/S11.7.3_A4_T1': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
'language/expressions/unsigned-right-shift/S11.7.3_A4_T4': [PASS, ['mode == debug or dcheck_always_on == True', FAIL]],
# TODO(4680,rmcilroy): Test262Error: Expected a RangeError to be thrown but no exception was thrown at all
'built-ins/Date/prototype/toISOString/15.9.5.43-0-13': [FAIL],
}], # ignition == True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment