Commit 119f3112 authored by mythria's avatar mythria Committed by Commit bot

[Interpreter] Enable allocation site mementos in CreateArrayLiterals.

In ignition, allocation site mementos were disabled when creating array
literals. Enabled them in this cl.

BUG=v8:4280
LOG=N

Review-Url: https://codereview.chromium.org/2294913006
Cr-Commit-Position: refs/heads/master@{#39234}
parent 8ee581af
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "src/compiler/bytecode-graph-builder.h" #include "src/compiler/bytecode-graph-builder.h"
#include "src/ast/ast.h"
#include "src/compilation-info.h" #include "src/compilation-info.h"
#include "src/compiler/bytecode-branch-analysis.h" #include "src/compiler/bytecode-branch-analysis.h"
#include "src/compiler/linkage.h" #include "src/compiler/linkage.h"
...@@ -1012,6 +1013,11 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() { ...@@ -1012,6 +1013,11 @@ void BytecodeGraphBuilder::VisitCreateArrayLiteral() {
bytecode_iterator().GetConstantForIndexOperand(0)); bytecode_iterator().GetConstantForIndexOperand(0));
int literal_index = bytecode_iterator().GetIndexOperand(1); int literal_index = bytecode_iterator().GetIndexOperand(1);
int literal_flags = bytecode_iterator().GetFlagOperand(2); int literal_flags = bytecode_iterator().GetFlagOperand(2);
// Disable allocation site mementos. Only unoptimized code will collect
// feedback about allocation site. Once the code is optimized we expect the
// data to converge. So, we disable allocation site mementos in optimized
// code. We can revisit this when we have data to the contrary.
literal_flags |= ArrayLiteral::kDisableMementos;
int number_of_elements = constant_elements->length(); int number_of_elements = constant_elements->length();
const Operator* op = javascript()->CreateLiteralArray( const Operator* op = javascript()->CreateLiteralArray(
constant_elements, literal_flags, literal_index, number_of_elements); constant_elements, literal_flags, literal_index, number_of_elements);
......
...@@ -1873,8 +1873,7 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { ...@@ -1873,8 +1873,7 @@ void BytecodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
// Deep-copy the literal boilerplate. // Deep-copy the literal boilerplate.
builder()->CreateArrayLiteral(expr->constant_elements(), builder()->CreateArrayLiteral(expr->constant_elements(),
expr->literal_index(), expr->literal_index(), expr->ComputeFlags());
expr->ComputeFlags(true));
Register index, literal; Register index, literal;
// Evaluate all the non-constant subexpressions and store them into the // Evaluate all the non-constant subexpressions and store them into the
......
...@@ -370,14 +370,6 @@ ...@@ -370,14 +370,6 @@
'test-cpu-profiler/CollectDeoptEvents': [FAIL], 'test-cpu-profiler/CollectDeoptEvents': [FAIL],
'test-cpu-profiler/DeoptUntrackedFunction': [SKIP], 'test-cpu-profiler/DeoptUntrackedFunction': [SKIP],
# BUG(4680): Ignition doesn't support mementos when creating array literals.
'test-heap/OptimizedPretenuringAllocationFolding': [FAIL],
'test-heap/OptimizedPretenuringdoubleArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedDoubleLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedMixedArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedObjectLiterals': [FAIL],
'test-heap/OptimizedPretenuringObjectArrayLiterals': [FAIL],
# BUG(4751). Flaky with ignition. # BUG(4751). Flaky with ignition.
'test-cpu-profiler/JsNativeJsSample': [PASS, FAIL], 'test-cpu-profiler/JsNativeJsSample': [PASS, FAIL],
...@@ -402,12 +394,6 @@ ...@@ -402,12 +394,6 @@
'test-cpu-profiler/DeoptAtSecondLevelInlinedSource': [FAIL], 'test-cpu-profiler/DeoptAtSecondLevelInlinedSource': [FAIL],
'test-feedback-vector/VectorCallFeedbackForArray': [FAIL], 'test-feedback-vector/VectorCallFeedbackForArray': [FAIL],
'test-heap/CompilationCacheCachingBehavior': [FAIL], 'test-heap/CompilationCacheCachingBehavior': [FAIL],
'test-heap/OptimizedPretenuringAllocationFolding': [FAIL],
'test-heap/OptimizedPretenuringdoubleArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedDoubleLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedMixedArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedObjectLiterals': [FAIL],
'test-heap/OptimizedPretenuringObjectArrayLiterals': [FAIL],
'test-heap/Regress169209': [FAIL], 'test-heap/Regress169209': [FAIL],
'test-heap/TestCodeFlushing': [FAIL], 'test-heap/TestCodeFlushing': [FAIL],
'test-heap/TestCodeFlushingIncremental': [FAIL], 'test-heap/TestCodeFlushingIncremental': [FAIL],
...@@ -493,15 +479,6 @@ ...@@ -493,15 +479,6 @@
'test-cpu-profiler/CollectDeoptEvents': [FAIL], 'test-cpu-profiler/CollectDeoptEvents': [FAIL],
'test-cpu-profiler/DeoptUntrackedFunction': [SKIP], 'test-cpu-profiler/DeoptUntrackedFunction': [SKIP],
# TODO(mythria, 4780): In interpreter we disable mementos when creating array
# literals.
'test-heap/OptimizedPretenuringAllocationFolding': [FAIL],
'test-heap/OptimizedPretenuringdoubleArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedDoubleLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedMixedArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedObjectLiterals': [FAIL],
'test-heap/OptimizedPretenuringObjectArrayLiterals': [FAIL],
# BUG(4751). Flaky with Ignition. # BUG(4751). Flaky with Ignition.
'test-cpu-profiler/JsNativeJsSample': [SKIP], 'test-cpu-profiler/JsNativeJsSample': [SKIP],
......
...@@ -15,7 +15,7 @@ parameter count: 1 ...@@ -15,7 +15,7 @@ parameter count: 1
bytecode array length: 6 bytecode array length: 6
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 34 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(1),
/* 51 S> */ B(Return), /* 51 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -35,7 +35,7 @@ bytecodes: [ ...@@ -35,7 +35,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(1),
B(Star), R(2), B(Star), R(2),
B(LdaZero), B(LdaZero),
B(Star), R(1), B(Star), R(1),
...@@ -63,7 +63,7 @@ parameter count: 1 ...@@ -63,7 +63,7 @@ parameter count: 1
bytecode array length: 6 bytecode array length: 6
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 34 S> */ B(CreateArrayLiteral), U8(0), U8(2), U8(2), /* 34 S> */ B(CreateArrayLiteral), U8(0), U8(2), U8(0),
/* 62 S> */ B(Return), /* 62 S> */ B(Return),
] ]
constant pool: [ constant pool: [
...@@ -83,11 +83,11 @@ bytecodes: [ ...@@ -83,11 +83,11 @@ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaSmi), U8(1), /* 42 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 45 S> */ B(CreateArrayLiteral), U8(0), U8(2), U8(2), /* 45 S> */ B(CreateArrayLiteral), U8(0), U8(2), U8(0),
B(Star), R(2), B(Star), R(2),
B(LdaZero), B(LdaZero),
B(Star), R(1), B(Star), R(1),
B(CreateArrayLiteral), U8(1), U8(0), U8(3), B(CreateArrayLiteral), U8(1), U8(0), U8(1),
B(Star), R(4), B(Star), R(4),
B(LdaZero), B(LdaZero),
B(Star), R(3), B(Star), R(3),
...@@ -97,7 +97,7 @@ bytecodes: [ ...@@ -97,7 +97,7 @@ bytecodes: [
B(StaKeyedPropertySloppy), R(2), R(1), U8(6), B(StaKeyedPropertySloppy), R(2), R(1), U8(6),
B(LdaSmi), U8(1), B(LdaSmi), U8(1),
B(Star), R(1), B(Star), R(1),
B(CreateArrayLiteral), U8(2), U8(1), U8(3), B(CreateArrayLiteral), U8(2), U8(1), U8(1),
B(Star), R(4), B(Star), R(4),
B(LdaZero), B(LdaZero),
B(Star), R(3), B(Star), R(3),
......
...@@ -784,7 +784,7 @@ bytecodes: [ ...@@ -784,7 +784,7 @@ bytecodes: [
B(Star), R(0), B(Star), R(0),
/* 2591 S> */ B(LdaConstant), U8(255), /* 2591 S> */ B(LdaConstant), U8(255),
B(Star), R(0), B(Star), R(0),
/* 2601 S> */ B(Wide), B(CreateArrayLiteral), U16(256), U16(0), U8(3), /* 2601 S> */ B(Wide), B(CreateArrayLiteral), U16(256), U16(0), U8(1),
/* 2619 S> */ B(Return), /* 2619 S> */ B(Return),
] ]
constant pool: [ constant pool: [
......
...@@ -77,7 +77,7 @@ bytecode array length: 14 ...@@ -77,7 +77,7 @@ bytecode array length: 14
bytecodes: [ bytecodes: [
/* 10 E> */ B(StackCheck), /* 10 E> */ B(StackCheck),
/* 15 S> */ B(LdrUndefined), R(0), /* 15 S> */ B(LdrUndefined), R(0),
B(CreateArrayLiteral), U8(0), U8(0), U8(3), B(CreateArrayLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
B(CallJSRuntime), U8(134), R(0), U8(2), B(CallJSRuntime), U8(134), R(0), U8(2),
/* 44 S> */ B(Return), /* 44 S> */ B(Return),
......
...@@ -257,7 +257,7 @@ bytecodes: [ ...@@ -257,7 +257,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 44 S> */ B(LdaSmi), U8(1), /* 44 S> */ B(LdaSmi), U8(1),
B(Star), R(0), B(Star), R(0),
/* 55 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 55 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(1),
B(Star), R(1), B(Star), R(1),
/* 63 S> */ B(Ldar), R(0), /* 63 S> */ B(Ldar), R(0),
B(ToNumber), R(3), B(ToNumber), R(3),
......
...@@ -108,7 +108,7 @@ bytecodes: [ ...@@ -108,7 +108,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(LdaZero), /* 42 S> */ B(LdaZero),
B(Star), R(0), B(Star), R(0),
/* 59 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 59 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(1),
B(JumpIfUndefined), U8(45), B(JumpIfUndefined), U8(45),
B(JumpIfNull), U8(43), B(JumpIfNull), U8(43),
B(ToObject), R(3), B(ToObject), R(3),
...@@ -153,7 +153,7 @@ bytecodes: [ ...@@ -153,7 +153,7 @@ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1), /* 42 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(1), R(1),
B(Mov), R(1), R(0), B(Mov), R(1), R(0),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3), /* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(1),
B(JumpIfUndefined), U8(67), B(JumpIfUndefined), U8(67),
B(JumpIfNull), U8(65), B(JumpIfNull), U8(65),
B(ToObject), R(1), B(ToObject), R(1),
...@@ -203,9 +203,9 @@ parameter count: 1 ...@@ -203,9 +203,9 @@ parameter count: 1
bytecode array length: 61 bytecode array length: 61
bytecodes: [ bytecodes: [
/* 30 E> */ B(StackCheck), /* 30 E> */ B(StackCheck),
/* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(1),
B(Star), R(0), B(Star), R(0),
/* 72 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3), /* 72 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(1),
B(JumpIfUndefined), U8(48), B(JumpIfUndefined), U8(48),
B(JumpIfNull), U8(46), B(JumpIfNull), U8(46),
B(ToObject), R(1), B(ToObject), R(1),
......
...@@ -19,7 +19,7 @@ bytecodes: [ ...@@ -19,7 +19,7 @@ bytecodes: [
B(Star), R(4), B(Star), R(4),
B(Mov), R(context), R(11), B(Mov), R(context), R(11),
B(Mov), R(context), R(12), B(Mov), R(context), R(12),
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(1),
B(Star), R(14), B(Star), R(14),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
/* 48 E> */ B(LdrKeyedProperty), R(14), U8(3), R(13), /* 48 E> */ B(LdrKeyedProperty), R(14), U8(3), R(13),
...@@ -303,7 +303,7 @@ bytecodes: [ ...@@ -303,7 +303,7 @@ bytecodes: [
B(Star), R(4), B(Star), R(4),
B(Mov), R(context), R(11), B(Mov), R(context), R(11),
B(Mov), R(context), R(12), B(Mov), R(context), R(12),
/* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(3), /* 48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(1),
B(Star), R(14), B(Star), R(14),
B(LdaConstant), U8(1), B(LdaConstant), U8(1),
/* 48 E> */ B(LdrKeyedProperty), R(14), U8(3), R(13), /* 48 E> */ B(LdrKeyedProperty), R(14), U8(3), R(13),
...@@ -451,7 +451,7 @@ bytecodes: [ ...@@ -451,7 +451,7 @@ bytecodes: [
B(Star), R(3), B(Star), R(3),
B(Mov), R(context), R(10), B(Mov), R(context), R(10),
B(Mov), R(context), R(11), B(Mov), R(context), R(11),
/* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(3), /* 77 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(1),
B(Star), R(13), B(Star), R(13),
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
/* 77 E> */ B(LdrKeyedProperty), R(13), U8(3), R(12), /* 77 E> */ B(LdrKeyedProperty), R(13), U8(3), R(12),
......
...@@ -333,7 +333,7 @@ bytecodes: [ ...@@ -333,7 +333,7 @@ bytecodes: [
B(StaContextSlot), R(1), U8(9), B(StaContextSlot), R(1), U8(9),
B(Mov), R(context), R(10), B(Mov), R(context), R(10),
B(Mov), R(context), R(11), B(Mov), R(context), R(11),
/* 30 S> */ B(CreateArrayLiteral), U8(1), U8(0), U8(3), /* 30 S> */ B(CreateArrayLiteral), U8(1), U8(0), U8(1),
B(Star), R(13), B(Star), R(13),
B(LdaConstant), U8(2), B(LdaConstant), U8(2),
/* 30 E> */ B(LdrKeyedProperty), R(13), U8(3), R(12), /* 30 E> */ B(LdrKeyedProperty), R(13), U8(3), R(12),
......
...@@ -640,11 +640,6 @@ ...@@ -640,11 +640,6 @@
# TODO(mythria, 4780): Related to lack of allocation site feedback for calls # TODO(mythria, 4780): Related to lack of allocation site feedback for calls
# in interpreter. # in interpreter.
'array-feedback': [FAIL], 'array-feedback': [FAIL],
'regress/regress-4121': [FAIL],
# TODO(mythria, 4780): In interpreter we disable mementos when creating array
# literals.
'array-literal-feedback': [FAIL],
# TODO(4680): Test doesn't know about three tier compiler pipeline. # TODO(4680): Test doesn't know about three tier compiler pipeline.
'assert-opt-and-deopt': [SKIP], 'assert-opt-and-deopt': [SKIP],
...@@ -681,7 +676,6 @@ ...@@ -681,7 +676,6 @@
'smi-mul-const': [FAIL], 'smi-mul-const': [FAIL],
'smi-mul': [FAIL], 'smi-mul': [FAIL],
'unary-minus-deopt': [FAIL], 'unary-minus-deopt': [FAIL],
'allocation-site-info': [FAIL],
}], # variant == ignition }], # variant == ignition
['variant == ignition and arch == arm64', { ['variant == ignition and arch == arm64', {
...@@ -715,9 +709,7 @@ ...@@ -715,9 +709,7 @@
############################################################################## ##############################################################################
['variant == ignition_staging', { ['variant == ignition_staging', {
'allocation-site-info': [FAIL],
'array-feedback': [FAIL], 'array-feedback': [FAIL],
'array-literal-feedback': [FAIL],
'assert-opt-and-deopt': [SKIP], 'assert-opt-and-deopt': [SKIP],
'compiler/deopt-inlined-from-call': [FAIL], 'compiler/deopt-inlined-from-call': [FAIL],
'compiler/increment-typefeedback': [FAIL], 'compiler/increment-typefeedback': [FAIL],
...@@ -739,7 +731,6 @@ ...@@ -739,7 +731,6 @@
'regress/regress-3176': [FAIL], 'regress/regress-3176': [FAIL],
'regress/regress-3709': [FAIL], 'regress/regress-3709': [FAIL],
'regress/regress-385565': [FAIL], 'regress/regress-385565': [FAIL],
'regress/regress-4121': [FAIL],
'regress/regress-crbug-594183': [FAIL], 'regress/regress-crbug-594183': [FAIL],
'regress/regress-embedded-cons-string': [FAIL], 'regress/regress-embedded-cons-string': [FAIL],
'regress/regress-map-invalidation-2': [FAIL], 'regress/regress-map-invalidation-2': [FAIL],
...@@ -772,14 +763,8 @@ ...@@ -772,14 +763,8 @@
# TODO(mythria, 4780): Related to lack of allocation site feedback for calls # TODO(mythria, 4780): Related to lack of allocation site feedback for calls
# in interpreter. # in interpreter.
'regress/regress-4121': [FAIL],
'array-feedback': [FAIL], 'array-feedback': [FAIL],
# TODO(mythria, 4780): In interpreter we disable mementos when creating array
# literals.
'array-literal-feedback': [FAIL],
'allocation-site-info': [FAIL],
'wasm/asm-wasm-f32': [PASS, ['arch in [arm64]', SKIP]], 'wasm/asm-wasm-f32': [PASS, ['arch in [arm64]', SKIP]],
'wasm/asm-wasm-f64': [PASS, ['arch in [arm64]', SKIP]], 'wasm/asm-wasm-f64': [PASS, ['arch in [arm64]', SKIP]],
......
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