aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-feedback-vector.cc
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2019-05-28 08:46:21 -0400
committerRefael Ackermann <refack@gmail.com>2019-06-01 09:55:12 -0400
commited74896b1fae1c163b3906163f3bf46326618ddb (patch)
tree7fb05c5a19808e0c5cd95837528e9005999cf540 /deps/v8/test/cctest/test-feedback-vector.cc
parent2a850cd0664a4eee51f44d0bb8c2f7a3fe444154 (diff)
downloadandroid-node-v8-ed74896b1fae1c163b3906163f3bf46326618ddb.tar.gz
android-node-v8-ed74896b1fae1c163b3906163f3bf46326618ddb.tar.bz2
android-node-v8-ed74896b1fae1c163b3906163f3bf46326618ddb.zip
deps: update V8 to 7.5.288.22
PR-URL: https://github.com/nodejs/node/pull/27375 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/v8/test/cctest/test-feedback-vector.cc')
-rw-r--r--deps/v8/test/cctest/test-feedback-vector.cc47
1 files changed, 38 insertions, 9 deletions
diff --git a/deps/v8/test/cctest/test-feedback-vector.cc b/deps/v8/test/cctest/test-feedback-vector.cc
index c8ffddbf7b..22fdbead59 100644
--- a/deps/v8/test/cctest/test-feedback-vector.cc
+++ b/deps/v8/test/cctest/test-feedback-vector.cc
@@ -89,15 +89,11 @@ TEST(VectorStructure) {
{
FeedbackVectorSpec spec(&zone);
spec.AddForInSlot();
- spec.AddCreateClosureSlot();
+ spec.AddFeedbackCellForCreateClosure();
spec.AddForInSlot();
vector = NewFeedbackVector(isolate, &spec);
FeedbackVectorHelper helper(vector);
- CHECK_EQ(1,
- FeedbackMetadata::GetSlotSize(FeedbackSlotKind::kCreateClosure));
- FeedbackSlot slot = helper.slot(1);
- FeedbackCell cell =
- FeedbackCell::cast(vector->Get(slot)->GetHeapObjectAssumeStrong());
+ FeedbackCell cell = *vector->GetClosureFeedbackCell(0);
CHECK_EQ(cell->value(), *factory->undefined_value());
}
}
@@ -161,6 +157,7 @@ TEST(VectorICMetadata) {
TEST(VectorCallICStates) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -168,7 +165,8 @@ TEST(VectorCallICStates) {
Isolate* isolate = CcTest::i_isolate();
// Make sure function f has a call that uses a type feedback slot.
CompileRun(
- "function foo() { return 17; }"
+ "function foo() { return 17; };"
+ "%EnsureFeedbackVectorForFunction(f);"
"function f(a) { a(); } f(foo);");
Handle<JSFunction> f = GetFunction("f");
// There should be one IC.
@@ -189,6 +187,7 @@ TEST(VectorCallICStates) {
TEST(VectorCallFeedback) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -197,6 +196,7 @@ TEST(VectorCallFeedback) {
// Make sure function f has a call that uses a type feedback slot.
CompileRun(
"function foo() { return 17; }"
+ "%EnsureFeedbackVectorForFunction(f);"
"function f(a) { a(); } f(foo);");
Handle<JSFunction> f = GetFunction("f");
Handle<JSFunction> foo = GetFunction("foo");
@@ -219,13 +219,17 @@ TEST(VectorCallFeedback) {
TEST(VectorCallFeedbackForArray) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
v8::HandleScope scope(context->GetIsolate());
Isolate* isolate = CcTest::i_isolate();
// Make sure function f has a call that uses a type feedback slot.
- CompileRun("function f(a) { a(); } f(Array);");
+ CompileRun(
+ "function f(a) { a(); };"
+ "%EnsureFeedbackVectorForFunction(f);"
+ "f(Array);");
Handle<JSFunction> f = GetFunction("f");
// There should be one IC.
Handle<FeedbackVector> feedback_vector =
@@ -256,6 +260,8 @@ size_t GetFeedbackVectorLength(Isolate* isolate, const char* src,
TEST(OneShotCallICSlotCount) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ if (i::FLAG_lazy_feedback_allocation) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -310,6 +316,7 @@ TEST(OneShotCallICSlotCount) {
TEST(VectorCallCounts) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -319,6 +326,7 @@ TEST(VectorCallCounts) {
// Make sure function f has a call that uses a type feedback slot.
CompileRun(
"function foo() { return 17; }"
+ "%EnsureFeedbackVectorForFunction(f);"
"function f(a) { a(); } f(foo);");
Handle<JSFunction> f = GetFunction("f");
// There should be one IC.
@@ -341,6 +349,7 @@ TEST(VectorCallCounts) {
TEST(VectorConstructCounts) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -350,6 +359,7 @@ TEST(VectorConstructCounts) {
// Make sure function f has a call that uses a type feedback slot.
CompileRun(
"function Foo() {}"
+ "%EnsureFeedbackVectorForFunction(f);"
"function f(a) { new a(); } f(Foo);");
Handle<JSFunction> f = GetFunction("f");
Handle<FeedbackVector> feedback_vector =
@@ -374,6 +384,7 @@ TEST(VectorConstructCounts) {
TEST(VectorSpeculationMode) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -383,6 +394,7 @@ TEST(VectorSpeculationMode) {
// Make sure function f has a call that uses a type feedback slot.
CompileRun(
"function Foo() {}"
+ "%EnsureFeedbackVectorForFunction(f);"
"function f(a) { new a(); } f(Foo);");
Handle<JSFunction> f = GetFunction("f");
Handle<FeedbackVector> feedback_vector =
@@ -408,6 +420,7 @@ TEST(VectorSpeculationMode) {
TEST(VectorLoadICStates) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -417,6 +430,7 @@ TEST(VectorLoadICStates) {
// Make sure function f has a call that uses a type feedback slot.
CompileRun(
"var o = { foo: 3 };"
+ "%EnsureFeedbackVectorForFunction(f);"
"function f(a) { return a.foo; } f(o);");
Handle<JSFunction> f = GetFunction("f");
// There should be one IC.
@@ -463,6 +477,7 @@ TEST(VectorLoadICStates) {
TEST(VectorLoadGlobalICSlotSharing) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -478,6 +493,7 @@ TEST(VectorLoadGlobalICSlotSharing) {
" var y = typeof o;"
" return o , typeof o, x , y, o;"
"}"
+ "%EnsureFeedbackVectorForFunction(f);"
"f();");
Handle<JSFunction> f = GetFunction("f");
// There should be two IC slots for {o} references outside and inside
@@ -498,6 +514,7 @@ TEST(VectorLoadGlobalICSlotSharing) {
TEST(VectorLoadICOnSmi) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -508,6 +525,7 @@ TEST(VectorLoadICOnSmi) {
// Make sure function f has a call that uses a type feedback slot.
CompileRun(
"var o = { foo: 3 };"
+ "%EnsureFeedbackVectorForFunction(f);"
"function f(a) { return a.foo; } f(o);");
Handle<JSFunction> f = GetFunction("f");
// There should be one IC.
@@ -558,6 +576,7 @@ TEST(VectorLoadICOnSmi) {
TEST(ReferenceContextAllocatesNoSlots) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -571,6 +590,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
" y = a;"
" return y;"
"}"
+ "%EnsureFeedbackVectorForFunction(testvar);"
"a = 3;"
"testvar({});");
@@ -592,6 +612,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
" 'use strict';"
" x.blue = a;"
"}"
+ "%EnsureFeedbackVectorForFunction(testprop);"
"testprop({ blue: 3 });");
Handle<JSFunction> f = GetFunction("testprop");
@@ -610,6 +631,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
" x().blue = a;"
" return x().blue;"
"}"
+ "%EnsureFeedbackVectorForFunction(testpropfunc);"
"function makeresult() { return { blue: 3 }; }"
"testpropfunc(makeresult);");
@@ -633,6 +655,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
" x[0] = a;"
" return x[0];"
"}"
+ "%EnsureFeedbackVectorForFunction(testkeyedprop);"
"testkeyedprop([0, 1, 2]);");
Handle<JSFunction> f = GetFunction("testkeyedprop");
@@ -654,6 +677,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
" x[0] = a;"
" return x[0];"
"}"
+ "%EnsureFeedbackVectorForFunction(testkeyedprop);"
"testkeyedprop([0, 1, 2]);");
Handle<JSFunction> f = GetFunction("testkeyedprop");
@@ -675,6 +699,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
" x.old = x.young = x.in_between = a;"
" return x.old + x.young;"
"}"
+ "%EnsureFeedbackVectorForFunction(testcompound);"
"testcompound({ old: 3, young: 3, in_between: 3 });");
Handle<JSFunction> f = GetFunction("testcompound");
@@ -698,6 +723,7 @@ TEST(ReferenceContextAllocatesNoSlots) {
TEST(VectorStoreICBasic) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -706,7 +732,8 @@ TEST(VectorStoreICBasic) {
CompileRun(
"function f(a) {"
" a.foo = 5;"
- "}"
+ "};"
+ "%EnsureFeedbackVectorForFunction(f);"
"var a = { foo: 3 };"
"f(a);"
"f(a);"
@@ -724,6 +751,7 @@ TEST(VectorStoreICBasic) {
TEST(StoreOwnIC) {
if (!i::FLAG_use_ic) return;
if (i::FLAG_always_opt) return;
+ FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
LocalContext context;
@@ -733,6 +761,7 @@ TEST(StoreOwnIC) {
"function f(v) {"
" return {a: 0, b: v, c: 0};"
"}"
+ "%EnsureFeedbackVectorForFunction(f);"
"f(1);"
"f(2);"
"f(3);");