41 using namespace v8::internal;
45 static void SimulateIncrementalMarking() {
55 CHECK(marking->IsMarking());
63 static void CheckMap(
Map*
map,
int type,
int instance_size) {
64 CHECK(map->IsHeapObject());
84 static void CheckOddball(
Isolate* isolate,
Object*
obj,
const char*
string) {
85 CHECK(obj->IsOddball());
94 static void CheckSmi(
Isolate* isolate,
int value,
const char*
string) {
103 static void CheckNumber(
Isolate* isolate,
double value,
const char*
string) {
105 CHECK(obj->IsNumber());
114 static void CheckFindCodeObject(
Isolate* isolate) {
129 CHECK(code->IsCode());
132 Address obj_addr = obj->address();
143 CHECK(copy->IsCode());
146 obj_copy->Size() / 2);
147 CHECK(not_right != code);
169 CHECK(value->IsHeapNumber());
170 CHECK(value->IsNumber());
174 CHECK(value->IsSmi());
175 CHECK(value->IsNumber());
179 CHECK(value->IsSmi());
180 CHECK(value->IsNumber());
184 CHECK(value->IsSmi());
185 CHECK(value->IsNumber());
189 CHECK(value->IsSmi());
190 CHECK(value->IsNumber());
193 #if !defined(V8_TARGET_ARCH_X64) && !defined(V8_TARGET_ARCH_ARM64)
196 CHECK(value->IsHeapNumber());
197 CHECK(value->IsNumber());
201 MaybeObject* maybe_value =
203 value = maybe_value->ToObjectChecked();
204 CHECK(value->IsHeapNumber());
205 CHECK(value->IsNumber());
210 value = maybe_value->ToObjectChecked();
211 CHECK(value->IsHeapNumber());
212 CHECK(value->IsNumber());
213 CHECK_EQ(static_cast<double>(static_cast<uint32_t>(1) << 31),
217 CHECK(heap->nan_value()->IsNumber());
221 CHECK(s->IsString());
229 CheckOddball(isolate, heap->true_value(),
"true");
230 CheckOddball(isolate, heap->false_value(),
"false");
231 CheckOddball(isolate, heap->null_value(),
"null");
232 CheckOddball(isolate, heap->undefined_value(),
"undefined");
235 CheckSmi(isolate, 0,
"0");
236 CheckSmi(isolate, 42,
"42");
237 CheckSmi(isolate, -42,
"-42");
240 CheckNumber(isolate, 1.1,
"1.1");
242 CheckFindCodeObject(isolate);
284 factory->
NewFunction(name, factory->undefined_value());
287 function->set_initial_map(*initial_map);
305 CHECK(func_value->IsJSFunction());
321 GetProperty(*obj_name)->ToObjectChecked()->IsJSObject());
329 static void VerifyStringAllocation(
Isolate* isolate,
const char*
string) {
333 for (
int index = 0; index < s->length(); index++) {
334 CHECK_EQ(static_cast<uint16_t>(
string[index]), s->Get(index));
343 VerifyStringAllocation(isolate,
"a");
344 VerifyStringAllocation(isolate,
"ab");
345 VerifyStringAllocation(isolate,
"abc");
346 VerifyStringAllocation(isolate,
"abcd");
347 VerifyStringAllocation(isolate,
"fiskerdrengen er paa havet");
357 const char*
name =
"Kasper the spunky";
381 h1 = global_handles->
Create(*i);
382 h2 = global_handles->
Create(*u);
383 h3 = global_handles->
Create(*i);
384 h4 = global_handles->
Create(*u);
390 CHECK((*h1)->IsString());
391 CHECK((*h2)->IsHeapNumber());
392 CHECK((*h3)->IsString());
393 CHECK((*h4)->IsHeapNumber());
405 static bool WeakPointerCleared =
false;
407 static void TestWeakGlobalHandleCallback(
409 std::pair<v8::Persistent<v8::Value>*,
int>* p =
410 reinterpret_cast<std::pair<v8::Persistent<v8::Value>*,
int>*>(
412 if (p->second == 1234) WeakPointerCleared =
true;
417 TEST(WeakGlobalHandlesScavenge) {
418 i::FLAG_stress_compaction =
false;
425 WeakPointerCleared =
false;
436 h1 = global_handles->
Create(*i);
437 h2 = global_handles->
Create(*u);
440 std::pair<Handle<Object>*,
int> handle_and_id(&h2, 1234);
442 reinterpret_cast<void*
>(&handle_and_id),
443 &TestWeakGlobalHandleCallback);
448 CHECK((*h1)->IsString());
449 CHECK((*h2)->IsHeapNumber());
451 CHECK(!WeakPointerCleared);
467 WeakPointerCleared =
false;
478 h1 = global_handles->
Create(*i);
479 h2 = global_handles->
Create(*u);
487 std::pair<Handle<Object>*,
int> handle_and_id(&h2, 1234);
489 reinterpret_cast<void*
>(&handle_and_id),
490 &TestWeakGlobalHandleCallback);
497 CHECK((*h1)->IsString());
499 CHECK(WeakPointerCleared);
507 i::FLAG_stress_compaction =
false;
514 WeakPointerCleared =
false;
522 h = global_handles->
Create(*i);
525 std::pair<Handle<Object>*,
int> handle_and_id(&h, 1234);
527 reinterpret_cast<void*
>(&handle_and_id),
528 &TestWeakGlobalHandleCallback);
533 CHECK(!WeakPointerCleared);
538 CHECK(WeakPointerCleared);
542 static const char* not_so_random_string_table[] = {
606 static void CheckInternalizedStrings(
const char** strings) {
607 for (
const char*
string = *strings; *strings != 0;
string = *strings++) {
611 if (!maybe_a->ToObject(&a))
continue;
612 CHECK(a->IsInternalizedString());
615 if (!maybe_b->ToObject(&b))
continue;
625 CheckInternalizedStrings(not_so_random_string_table);
626 CheckInternalizedStrings(not_so_random_string_table);
638 factory->
NewFunction(name, factory->undefined_value());
641 function->set_initial_map(*initial_map);
712 const char* string1 =
"fisk";
719 const char* string2 =
"fugl";
735 factory->
NewFunction(name, factory->undefined_value());
738 function->set_initial_map(*initial_map);
749 CHECK(*initial_map != obj->map());
775 CHECK(array->HasFastSmiOrObjectElements());
787 uint32_t int_length = 0;
788 CHECK(length->ToArrayIndex(&int_length));
790 CHECK(array->HasDictionaryElements());
794 uint32_t new_int_length = 0;
795 CHECK(array->length()->ToArrayIndex(&new_int_length));
796 CHECK_EQ(static_cast<double>(int_length), new_int_length - 1);
828 CHECK(!clone.is_identical_to(obj));
835 CHECK_EQ(obj->GetProperty(*first), clone->GetProperty(*first));
836 CHECK_EQ(obj->GetProperty(*second), clone->GetProperty(*second));
850 CHECK_EQ(obj->GetProperty(*second), clone->GetProperty(*first));
851 CHECK_EQ(obj->GetProperty(*first), clone->GetProperty(*second));
860 const unsigned char chars[] = { 0xe5, 0xa4, 0xa7 };
861 for (
int length = 0; length < 100; length++) {
863 char* non_ascii = NewArray<char>(3 * length + 1);
864 char* ascii = NewArray<char>(length + 1);
865 non_ascii[3 * length] = 0;
867 for (
int i = 0; i < length; i++) {
869 non_ascii[3 * i] = chars[0];
870 non_ascii[3 * i + 1] = chars[1];
871 non_ascii[3 * i + 2] = chars[2];
876 CHECK_EQ(length, non_ascii_sym->length());
879 CHECK_EQ(length, ascii_sym->length());
882 non_ascii_str->Hash();
883 CHECK_EQ(length, non_ascii_str->length());
887 CHECK_EQ(length, ascii_str->length());
898 HeapIterator iterator(heap);
899 for (
HeapObject* obj = iterator.next(); obj !=
NULL; obj = iterator.next()) {
900 for (
int i = 0; i <
size; i++) {
901 if (*objs[i] == obj) {
917 const int objs_count = 6;
919 int next_objs_index = 0;
922 objs[next_objs_index++] = factory->
NewJSArray(10);
923 objs[next_objs_index++] = factory->
NewJSArray(10,
928 objs[next_objs_index++] =
930 objs[next_objs_index++] =
935 char* str =
new char[large_size];
936 for (
int i = 0; i < large_size - 1; ++i) str[i] =
'a';
937 str[large_size - 1] =
'\0';
938 objs[next_objs_index++] =
945 CHECK_EQ(objs_count, next_objs_index);
966 static int LenFromSize(
int size) {
990 CHECK(object_ctor->has_initial_map());
991 Handle<Map> object_map(object_ctor->initial_map());
994 int n_properties = my_map->inobject_properties();
997 int object_size = my_map->instance_size();
1004 int allocation_len = LenFromSize(allocation_amount);
1008 while ((*limit_addr - *top_addr) > allocation_amount) {
1011 CHECK(!array->IsFailure());
1016 int to_fill =
static_cast<int>(*limit_addr - *top_addr - object_size);
1017 int fixed_array_len = LenFromSize(to_fill);
1022 CHECK(!array->IsFailure());
1029 CHECK_EQ(0, jsobject->properties()->length());
1031 jsobject->FastPropertyAtPut(-1, array);
1033 CHECK_EQ(0, static_cast<int>(*limit_addr - *top_addr));
1041 if (clone->
address() != old_pointer_space_top) {
1051 if (!FLAG_flush_code)
return;
1052 i::FLAG_allow_natives_syntax =
true;
1053 i::FLAG_optimize_for_size =
false;
1058 const char* source =
"function foo() {"
1074 CHECK(func_value->IsJSFunction());
1076 CHECK(function->shared()->is_compiled());
1081 CHECK(function->shared()->is_compiled());
1084 const int kAgingThreshold = 6;
1085 for (
int i = 0; i < kAgingThreshold; i++) {
1090 CHECK(!function->shared()->is_compiled() ||
function->IsOptimized());
1091 CHECK(!function->is_compiled() ||
function->IsOptimized());
1093 CompileRun(
"foo()");
1094 CHECK(function->shared()->is_compiled());
1095 CHECK(function->is_compiled());
1101 if (!FLAG_flush_code)
return;
1102 i::FLAG_allow_natives_syntax =
true;
1103 i::FLAG_optimize_for_size =
true;
1105 Isolate* isolate = Isolate::Current();
1108 const char* source =
"function foo() {"
1122 Object* func_value = Isolate::Current()->context()->global_object()->
1124 CHECK(func_value->IsJSFunction());
1126 CHECK(function->shared()->is_compiled());
1130 CHECK(function->shared()->is_compiled());
1135 CHECK(!function->shared()->is_compiled() ||
function->IsOptimized());
1146 CHECK(function->shared()->is_compiled());
1149 const int kAgingThreshold = 6;
1150 for (
int i = 0; i < kAgingThreshold; i++) {
1155 CHECK(!function->shared()->is_compiled() ||
function->IsOptimized());
1156 CHECK(!function->is_compiled() ||
function->IsOptimized());
1158 CompileRun(
"foo()");
1159 CHECK(function->shared()->is_compiled());
1160 CHECK(function->is_compiled());
1164 TEST(TestCodeFlushingIncremental) {
1166 if (!FLAG_flush_code || !FLAG_flush_code_incrementally)
return;
1167 i::FLAG_allow_natives_syntax =
true;
1168 i::FLAG_optimize_for_size =
false;
1173 const char* source =
"function foo() {"
1189 CHECK(func_value->IsJSFunction());
1191 CHECK(function->shared()->is_compiled());
1196 CHECK(function->shared()->is_compiled());
1199 const int kAgingThreshold = 6;
1200 for (
int i = 0; i < kAgingThreshold; i++) {
1201 SimulateIncrementalMarking();
1204 CHECK(!function->shared()->is_compiled() ||
function->IsOptimized());
1205 CHECK(!function->is_compiled() ||
function->IsOptimized());
1209 CompileRun(
"foo();");
1214 for (
int i = 0; i < kAgingThreshold; i++) {
1215 SimulateIncrementalMarking();
1216 if (!function->next_function_link()->IsUndefined())
break;
1223 CompileRun(
"%OptimizeFunctionOnNextCall(foo); foo();");
1228 CHECK(function->shared()->is_compiled() || !
function->IsOptimized());
1229 CHECK(function->is_compiled() || !
function->IsOptimized());
1233 TEST(TestCodeFlushingIncrementalScavenge) {
1235 if (!FLAG_flush_code || !FLAG_flush_code_incrementally)
return;
1236 i::FLAG_allow_natives_syntax =
true;
1237 i::FLAG_optimize_for_size =
false;
1242 const char* source =
"var foo = function() {"
1248 "var bar = function() {"
1266 CHECK(func_value->IsJSFunction());
1268 CHECK(function->shared()->is_compiled());
1271 CHECK(func_value2->IsJSFunction());
1273 CHECK(function2->shared()->is_compiled());
1277 CompileRun(
"foo = 0; bar = 0;");
1282 const int kAgingThreshold = 6;
1283 for (
int i = 0; i < kAgingThreshold; i++) {
1284 function->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
1285 function2->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
1291 SimulateIncrementalMarking();
1292 *function2.location() =
NULL;
1297 CHECK(!function->shared()->is_compiled() ||
function->IsOptimized());
1298 CHECK(!function->is_compiled() ||
function->IsOptimized());
1302 TEST(TestCodeFlushingIncrementalAbort) {
1304 if (!FLAG_flush_code || !FLAG_flush_code_incrementally)
return;
1305 i::FLAG_allow_natives_syntax =
true;
1306 i::FLAG_optimize_for_size =
false;
1312 const char* source =
"function foo() {"
1328 CHECK(func_value->IsJSFunction());
1330 CHECK(function->shared()->is_compiled());
1335 CHECK(function->shared()->is_compiled());
1338 const int kAgingThreshold = 6;
1339 for (
int i = 0; i < kAgingThreshold; i++) {
1340 function->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
1345 SimulateIncrementalMarking();
1347 #ifdef ENABLE_DEBUGGER_SUPPORT
1353 isolate->debug()->SetBreakPoint(
function, breakpoint_object, &position);
1354 isolate->debug()->ClearAllBreakPoints();
1355 #endif // ENABLE_DEBUGGER_SUPPORT
1359 CompileRun(
"%OptimizeFunctionOnNextCall(foo); foo();");
1364 CHECK(function->shared()->is_compiled() || !
function->IsOptimized());
1365 CHECK(function->is_compiled() || !
function->IsOptimized());
1373 while (!object->IsUndefined()) {
1400 if (FLAG_gc_global || FLAG_stress_compaction)
return;
1402 static const int kNumTestContexts = 10;
1412 for (
int i = 0; i < kNumTestContexts; i++) {
1429 const char* source =
"function f1() { };"
1430 "function f2() { };"
1431 "function f3() { };"
1432 "function f4() { };"
1433 "function f5() { };";
1435 CHECK_EQ(0, CountOptimizedUserFunctions(ctx[i]));
1437 CHECK_EQ(opt ? 1 : 0, CountOptimizedUserFunctions(ctx[i]));
1439 CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i]));
1441 CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i]));
1443 CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i]));
1445 CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[i]));
1448 CompileRun(
"f1=null");
1451 for (
int j = 0; j < 10; j++) {
1453 CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[i]));
1459 CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i]));
1462 CompileRun(
"f3=null");
1463 for (
int j = 0; j < 10; j++) {
1465 CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[i]));
1468 CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i]));
1469 CompileRun(
"f5=null");
1470 for (
int j = 0; j < 10; j++) {
1472 CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i]));
1475 CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i]));
1485 for (
int i = 0; i < kNumTestContexts; i++) {
1492 for (
int j = 0; j < 10; j++) {
1508 static int CountNativeContextsWithGC(
Isolate* isolate,
int n) {
1512 while (!object->IsUndefined()) {
1530 Isolate* isolate = icontext->GetIsolate();
1533 while (object->IsJSFunction() &&
1545 TEST(TestInternalWeakListsTraverseWithGC) {
1549 static const int kNumTestContexts = 10;
1558 for (
int i = 0; i < kNumTestContexts; i++) {
1561 CHECK_EQ(i + 1, CountNativeContextsWithGC(isolate, i / 2 + 1));
1569 const char* source =
"function f1() { };"
1570 "function f2() { };"
1571 "function f3() { };"
1572 "function f4() { };"
1573 "function f5() { };";
1575 CHECK_EQ(0, CountOptimizedUserFunctions(ctx[0]));
1577 CHECK_EQ(opt ? 1 : 0, CountOptimizedUserFunctions(ctx[0]));
1578 CHECK_EQ(opt ? 1 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 1));
1580 CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[0]));
1581 CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 1));
1583 CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[0]));
1584 CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 1));
1586 CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctions(ctx[0]));
1587 CHECK_EQ(opt ? 4 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 2));
1589 CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctions(ctx[0]));
1590 CHECK_EQ(opt ? 5 : 0, CountOptimizedUserFunctionsWithGC(ctx[0], 4));
1614 for (
int i = 1; i <= 100; i++) {
1616 CHECK_EQ(initial_size + i * filler_size,
1630 while (!
CcTest::heap()->old_pointer_space()->IsLazySweepingComplete()) {
1637 TEST(TestSizeOfObjectsVsHeapIteratorPrecision) {
1642 intptr_t size_of_objects_2 = 0;
1645 obj = iterator.next()) {
1646 if (!obj->IsFreeSpace()) {
1647 size_of_objects_2 += obj->Size();
1654 if (size_of_objects_1 > size_of_objects_2) {
1655 intptr_t delta = size_of_objects_1 - size_of_objects_2;
1659 size_of_objects_1, size_of_objects_2, delta);
1660 CHECK_GT(size_of_objects_1 / 20, delta);
1662 intptr_t delta = size_of_objects_2 - size_of_objects_1;
1666 size_of_objects_1, size_of_objects_2, delta);
1667 CHECK_GT(size_of_objects_2 / 20, delta);
1672 static void FillUpNewSpace(
NewSpace* new_space) {
1682 for (intptr_t i = 0; i < number_of_fillers; i++) {
1702 intptr_t old_capacity, new_capacity;
1703 old_capacity = new_space->
Capacity();
1705 new_capacity = new_space->
Capacity();
1706 CHECK(2 * old_capacity == new_capacity);
1708 old_capacity = new_space->
Capacity();
1709 FillUpNewSpace(new_space);
1710 new_capacity = new_space->
Capacity();
1711 CHECK(old_capacity == new_capacity);
1714 old_capacity = new_space->
Capacity();
1716 new_capacity = new_space->
Capacity();
1717 CHECK(old_capacity == new_capacity);
1724 old_capacity = new_space->
Capacity();
1726 new_capacity = new_space->
Capacity();
1727 CHECK(old_capacity == 2 * new_capacity);
1730 old_capacity = new_space->
Capacity();
1734 new_capacity = new_space->
Capacity();
1735 CHECK(old_capacity == new_capacity);
1739 TEST(CollectingAllAvailableGarbageShrinksNewSpace) {
1752 intptr_t old_capacity, new_capacity;
1753 old_capacity = new_space->
Capacity();
1755 new_capacity = new_space->
Capacity();
1756 CHECK(2 * old_capacity == new_capacity);
1757 FillUpNewSpace(new_space);
1759 new_capacity = new_space->
Capacity();
1760 CHECK(old_capacity == new_capacity);
1764 static int NumberOfGlobalObjects() {
1767 for (
HeapObject* obj = iterator.next(); obj !=
NULL; obj = iterator.next()) {
1768 if (obj->IsGlobalObject()) count++;
1777 i::FLAG_allow_natives_syntax =
true;
1790 CHECK_EQ(4, NumberOfGlobalObjects());
1794 CompileRun(
"var v = {x: 42}");
1799 ctx2->
Global()->Set(v8_str(
"o"), v);
1801 "function f() { return o.x; }"
1802 "for (var i = 0; i < 10; ++i) f();"
1803 "%OptimizeFunctionOnNextCall(f);"
1813 CHECK_EQ(2, NumberOfGlobalObjects());
1816 CHECK_EQ(0, NumberOfGlobalObjects());
1822 TEST(LeakNativeContextViaFunction) {
1823 i::FLAG_allow_natives_syntax =
true;
1836 CHECK_EQ(4, NumberOfGlobalObjects());
1840 CompileRun(
"var v = function() { return 42; }");
1845 ctx2->
Global()->Set(v8_str(
"o"), v);
1847 "function f(x) { return x(); }"
1848 "for (var i = 0; i < 10; ++i) f(o);"
1849 "%OptimizeFunctionOnNextCall(f);"
1859 CHECK_EQ(2, NumberOfGlobalObjects());
1862 CHECK_EQ(0, NumberOfGlobalObjects());
1866 TEST(LeakNativeContextViaMapKeyed) {
1867 i::FLAG_allow_natives_syntax =
true;
1880 CHECK_EQ(4, NumberOfGlobalObjects());
1884 CompileRun(
"var v = [42, 43]");
1889 ctx2->
Global()->Set(v8_str(
"o"), v);
1891 "function f() { return o[0]; }"
1892 "for (var i = 0; i < 10; ++i) f();"
1893 "%OptimizeFunctionOnNextCall(f);"
1903 CHECK_EQ(2, NumberOfGlobalObjects());
1906 CHECK_EQ(0, NumberOfGlobalObjects());
1910 TEST(LeakNativeContextViaMapProto) {
1911 i::FLAG_allow_natives_syntax =
true;
1924 CHECK_EQ(4, NumberOfGlobalObjects());
1928 CompileRun(
"var v = { y: 42}");
1933 ctx2->
Global()->Set(v8_str(
"o"), v);
1940 "for (var i = 0; i < 10; ++i) f();"
1941 "%OptimizeFunctionOnNextCall(f);"
1951 CHECK_EQ(2, NumberOfGlobalObjects());
1954 CHECK_EQ(0, NumberOfGlobalObjects());
1959 i::FLAG_allow_natives_syntax =
true;
1961 i::FLAG_verify_heap =
true;
1966 if (i::FLAG_force_marking_deque_overflows)
return;
1972 "function foo () { }"
1973 "function mkbar () { return new (new Function(\"\")) (); }"
1974 "function f (x) { return (x instanceof foo); }"
1975 "function g () { f(mkbar()); }"
1976 "f(new foo()); f(new foo());"
1977 "%OptimizeFunctionOnNextCall(f);"
1978 "f(new foo()); g();");
1990 CHECK(f->IsOptimized());
1992 while (!Marking::IsBlack(Marking::MarkBitFrom(f->code())) &&
1999 CHECK(marking->IsMarking());
2014 TEST(PrototypeTransitionClearing) {
2020 CompileRun(
"var base = {};");
2025 int initialTransitions = baseObject->map()->NumberOfProtoTransitions();
2029 "for (var i = 0; i < 10; i++) {"
2031 " var prototype = {};"
2032 " object.__proto__ = prototype;"
2033 " if (i >= 3) live.push(object, prototype);"
2038 baseObject->map()->NumberOfProtoTransitions());
2040 const int transitions = 10 - 3;
2041 CHECK_EQ(initialTransitions + transitions,
2042 baseObject->map()->NumberOfProtoTransitions());
2045 FixedArray* trans = baseObject->map()->GetPrototypeTransitions();
2046 for (
int i = initialTransitions; i < initialTransitions + transitions; i++) {
2051 CHECK(proto->IsJSObject());
2059 SimulateFullSpace(space);
2065 i::FLAG_always_compact =
true;
2077 TEST(ResetSharedFunctionInfoCountersDuringIncrementalMarking) {
2078 i::FLAG_stress_compaction =
false;
2079 i::FLAG_allow_natives_syntax =
true;
2081 i::FLAG_verify_heap =
true;
2093 " for (var i = 0; i < 100; i++) s += i;"
2097 "%OptimizeFunctionOnNextCall(f);"
2104 CHECK(f->IsOptimized());
2111 const int kLongIdlePauseInMs = 1000;
2115 while (!marking->IsStopped() && !marking->IsComplete()) {
2118 if (!marking->IsStopped() || marking->should_hurry()) {
2125 "Test finalizing incremental mark-sweep");
2129 CHECK_EQ(0, f->shared()->opt_count());
2130 CHECK_EQ(0, f->shared()->code()->profiler_ticks());
2134 TEST(ResetSharedFunctionInfoCountersDuringMarkSweep) {
2135 i::FLAG_stress_compaction =
false;
2136 i::FLAG_allow_natives_syntax =
true;
2138 i::FLAG_verify_heap =
true;
2150 " for (var i = 0; i < 100; i++) s += i;"
2154 "%OptimizeFunctionOnNextCall(f);"
2161 CHECK(f->IsOptimized());
2167 const int kLongIdlePauseInMs = 1000;
2172 CHECK_EQ(0, f->shared()->opt_count());
2173 CHECK_EQ(0, f->shared()->code()->profiler_ticks());
2178 TEST(OptimizedAllocationAlwaysInNewSpace) {
2179 i::FLAG_allow_natives_syntax =
true;
2182 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2190 " for (var i = 0; i < 32; i++) {"
2191 " this['x' + i] = x;"
2194 "function f(x) { return new c(x); };"
2196 "%OptimizeFunctionOnNextCall(f);"
2198 CHECK_EQ(4, res->ToObject()->GetRealNamedProperty(v8_str(
"x"))->Int32Value());
2207 TEST(OptimizedPretenuringAllocationFolding) {
2208 i::FLAG_allow_natives_syntax =
true;
2209 i::FLAG_max_new_space_size = 2048;
2210 i::FLAG_allocation_site_pretenuring =
false;
2213 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2218 "function DataObject() {"
2226 "var number_elements = 20000;"
2227 "var elements = new Array();"
2229 " for (var i = 0; i < number_elements; i++) {"
2230 " elements[i] = new DataObject();"
2232 " return elements[number_elements-1]"
2235 "%OptimizeFunctionOnNextCall(f);"
2250 TEST(OptimizedPretenuringAllocationFoldingBlocks) {
2251 i::FLAG_allow_natives_syntax =
true;
2252 i::FLAG_max_new_space_size = 2048;
2253 i::FLAG_allocation_site_pretenuring =
false;
2256 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2261 "var number_elements = 30000;"
2262 "var elements = new Array(number_elements);"
2263 "function DataObject() {"
2272 " for (var i = 0; i < number_elements; i++) {"
2273 " elements[i] = new DataObject();"
2275 " return elements[number_elements - 1];"
2278 "%OptimizeFunctionOnNextCall(f);"
2293 TEST(OptimizedPretenuringObjectArrayLiterals) {
2294 i::FLAG_allow_natives_syntax =
true;
2295 i::FLAG_max_new_space_size = 2048;
2298 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2302 "var number_elements = 20000;"
2303 "var elements = new Array(number_elements);"
2305 " for (var i = 0; i < number_elements; i++) {"
2306 " elements[i] = [{}, {}, {}];"
2308 " return elements[number_elements - 1];"
2311 "%OptimizeFunctionOnNextCall(f);"
2322 TEST(OptimizedPretenuringMixedInObjectProperties) {
2323 i::FLAG_allow_natives_syntax =
true;
2324 i::FLAG_max_new_space_size = 2048;
2327 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2331 "var number_elements = 20000;"
2332 "var elements = new Array(number_elements);"
2334 " for (var i = 0; i < number_elements; i++) {"
2335 " elements[i] = {a: {c: 2.2, d: {}}, b: 1.1};"
2337 " return elements[number_elements - 1];"
2340 "%OptimizeFunctionOnNextCall(f);"
2350 JSObject* inner_object =
reinterpret_cast<JSObject*
>(o->RawFastPropertyAt(0));
2357 TEST(OptimizedPretenuringDoubleArrayProperties) {
2358 i::FLAG_allow_natives_syntax =
true;
2359 i::FLAG_max_new_space_size = 2048;
2362 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2366 "var number_elements = 30000;"
2367 "var elements = new Array(number_elements);"
2369 " for (var i = 0; i < number_elements; i++) {"
2370 " elements[i] = {a: 1.1, b: 2.2};"
2372 " return elements[i - 1];"
2375 "%OptimizeFunctionOnNextCall(f);"
2386 TEST(OptimizedPretenuringdoubleArrayLiterals) {
2387 i::FLAG_allow_natives_syntax =
true;
2388 i::FLAG_max_new_space_size = 2048;
2391 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2395 "var number_elements = 30000;"
2396 "var elements = new Array(number_elements);"
2398 " for (var i = 0; i < number_elements; i++) {"
2399 " elements[i] = [1.1, 2.2, 3.3];"
2401 " return elements[number_elements - 1];"
2404 "%OptimizeFunctionOnNextCall(f);"
2415 TEST(OptimizedPretenuringNestedMixedArrayLiterals) {
2416 i::FLAG_allow_natives_syntax =
true;
2417 i::FLAG_max_new_space_size = 2048;
2420 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2424 "var number_elements = 20000;"
2425 "var elements = new Array(number_elements);"
2427 " for (var i = 0; i < number_elements; i++) {"
2428 " elements[i] = [[{}, {}, {}], [1.1, 2.2, 3.3]];"
2430 " return elements[number_elements - 1];"
2433 "%OptimizeFunctionOnNextCall(f);"
2453 TEST(OptimizedPretenuringNestedObjectLiterals) {
2454 i::FLAG_allow_natives_syntax =
true;
2455 i::FLAG_max_new_space_size = 2048;
2458 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2462 "var number_elements = 20000;"
2463 "var elements = new Array(number_elements);"
2465 " for (var i = 0; i < number_elements; i++) {"
2466 " elements[i] = [[{}, {}, {}],[{}, {}, {}]];"
2468 " return elements[number_elements - 1];"
2471 "%OptimizeFunctionOnNextCall(f);"
2491 TEST(OptimizedPretenuringNestedDoubleLiterals) {
2492 i::FLAG_allow_natives_syntax =
true;
2493 i::FLAG_max_new_space_size = 2048;
2496 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2500 "var number_elements = 20000;"
2501 "var elements = new Array(number_elements);"
2503 " for (var i = 0; i < number_elements; i++) {"
2504 " elements[i] = [[1.1, 1.2, 1.3],[2.1, 2.2, 2.3]];"
2506 " return elements[number_elements - 1];"
2509 "%OptimizeFunctionOnNextCall(f);"
2533 TEST(OptimizedPretenuringConstructorCalls) {
2534 if (!FLAG_allocation_site_pretenuring || !i::FLAG_pretenuring_call_new) {
2538 i::FLAG_allow_natives_syntax =
true;
2539 i::FLAG_max_new_space_size = 2048;
2542 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2546 "var number_elements = 20000;"
2547 "var elements = new Array(number_elements);"
2553 " for (var i = 0; i < number_elements; i++) {"
2554 " elements[i] = new foo();"
2556 " return elements[number_elements - 1];"
2559 "%OptimizeFunctionOnNextCall(f);"
2570 TEST(OptimizedAllocationArrayLiterals) {
2571 i::FLAG_allow_natives_syntax =
true;
2574 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2579 " var numbers = new Array(1, 2, 3);"
2580 " numbers[0] = 3.14;"
2584 "%OptimizeFunctionOnNextCall(f);"
2597 TEST(OptimizedPretenuringCallNew) {
2598 i::FLAG_allow_natives_syntax =
true;
2599 i::FLAG_allocation_site_pretenuring =
false;
2600 i::FLAG_pretenuring_call_new =
true;
2603 if (i::FLAG_gc_global || i::FLAG_stress_compaction)
return;
2609 "function g() { this.a = 0; }"
2614 "%OptimizeFunctionOnNextCall(f);"
2623 static int CountMapTransitions(
Map* map) {
2624 return map->transitions()->number_of_transitions();
2631 i::FLAG_stress_compaction =
false;
2632 i::FLAG_allow_natives_syntax =
true;
2633 i::FLAG_trace_incremental_marking =
true;
2636 static const int transitions_count = 256;
2640 for (
int i = 0; i < transitions_count; i++) {
2642 OS::SNPrintF(buffer,
"var o = new Object; o.prop%d = %d;", i, i);
2643 CompileRun(buffer.
start());
2645 CompileRun(
"var root = new Object;");
2654 int transitions_before = CountMapTransitions(root->map());
2655 CompileRun(
"%DebugPrint(root);");
2656 CHECK_EQ(transitions_count, transitions_before);
2658 SimulateIncrementalMarking();
2663 int transitions_after = CountMapTransitions(root->map());
2664 CompileRun(
"%DebugPrint(root);");
2670 i::FLAG_collect_maps =
true;
2671 i::FLAG_incremental_marking =
true;
2677 CompileRun(
"var root = new Object;"
2679 "root = new Object;");
2681 SimulateIncrementalMarking();
2686 CompileRun(
"function f(o) {"
2704 CHECK(root->IsJSObject());
2705 CHECK(root->map()->IsMap());
2710 i::FLAG_collect_maps =
true;
2711 i::FLAG_incremental_marking =
true;
2712 i::FLAG_allow_natives_syntax =
true;
2718 CompileRun(
"var root = new Object;"
2720 "root = new Object;");
2722 SimulateIncrementalMarking();
2727 CompileRun(
"function f(o) {"
2732 "%OptimizeFunctionOnNextCall(f);"
2734 "%DeoptimizeFunction(f);");
2748 CHECK(root->IsJSObject());
2749 CHECK(root->map()->IsMap());
2754 i::FLAG_trace_gc =
true;
2756 i::FLAG_crankshaft =
false;
2757 i::FLAG_always_opt =
false;
2763 static const int number_of_test_pages = 20;
2768 for (
int i = 0; i < number_of_test_pages; i++) {
2770 SimulateFullSpace(old_pointer_space);
2800 i::FLAG_stress_compaction =
false;
2810 const char* c =
"This text is long enough to trigger sliced strings.";
2812 CHECK(s->IsSeqOneByteString());
2820 CHECK(t->IsSlicedString());
2822 *slice.location() = *t.location();
2832 TEST(PrintSharedFunctionInfo) {
2835 const char* source =
"f = function() { return 987654321; }\n"
2836 "g = function() { return 123456789; }\n";
2844 g->shared()->PrintLn();
2846 #endif // OBJECT_PRINT
2857 for (
int i = 0; i < 2; i++) {
2861 CHECK(internal_obj->HasFastProperties());
2871 internal_obj->GetHiddenProperty(heap->identity_hash_string()));
2875 DescriptorArray* descriptors = internal_obj->map()->instance_descriptors();
2877 internal_obj->RawFastPropertyAt(descriptors->
GetFieldIndex(0)));
2884 TEST(IncrementalMarkingClearsTypeFeedbackInfo) {
2885 if (i::FLAG_always_opt)
return;
2892 CompileRun(
"function fun() {};");
2893 fun1 = env->
Global()->Get(v8_str(
"fun"));
2898 CompileRun(
"function fun() {};");
2899 fun2 = env->
Global()->Get(v8_str(
"fun"));
2906 CompileRun(
"function f(a, b) { a(); b(); } f(fun1, fun2);");
2914 f->shared()->code()->type_feedback_info())->feedback_vector());
2916 CHECK_EQ(2, feedback_vector->length());
2917 CHECK(feedback_vector->get(0)->IsJSFunction());
2918 CHECK(feedback_vector->get(1)->IsJSFunction());
2920 SimulateIncrementalMarking();
2923 CHECK_EQ(2, feedback_vector->length());
2932 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) |
2933 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) |
2934 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID);
2936 RelocInfo*
info = it.rinfo();
2946 TEST(IncrementalMarkingPreservesMonomorphicIC) {
2947 if (i::FLAG_always_opt)
return;
2953 CompileRun(
"function fun() { this.x = 1; }; var obj = new fun();"
2954 "function f(o) { return o.x; } f(obj); f(obj);");
2960 Code* ic_before = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
2963 SimulateIncrementalMarking();
2966 Code* ic_after = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
2971 TEST(IncrementalMarkingClearsMonomorphicIC) {
2972 if (i::FLAG_always_opt)
return;
2979 CompileRun(
"function fun() { this.x = 1; }; var obj = new fun();");
2980 obj1 = env->
Global()->Get(v8_str(
"obj"));
2986 CompileRun(
"function f(o) { return o.x; } f(obj1); f(obj1);");
2992 Code* ic_before = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
2997 SimulateIncrementalMarking();
3000 Code* ic_after = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
3005 TEST(IncrementalMarkingClearsPolymorphicIC) {
3006 if (i::FLAG_always_opt)
return;
3013 CompileRun(
"function fun() { this.x = 1; }; var obj = new fun();");
3014 obj1 = env->
Global()->Get(v8_str(
"obj"));
3019 CompileRun(
"function fun() { this.x = 2; }; var obj = new fun();");
3020 obj2 = env->
Global()->Get(v8_str(
"obj"));
3027 CompileRun(
"function f(o) { return o.x; } f(obj1); f(obj1); f(obj2);");
3033 Code* ic_before = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
3038 SimulateIncrementalMarking();
3041 Code* ic_after = FindFirstIC(f->shared()->code(), Code::LOAD_IC);
3049 : data_(data), length_(strlen(data)) { }
3056 const char*
data()
const {
return data_; }
3086 CompileRun(accessor);
3096 if (i::FLAG_always_opt) {
3101 FLAG_use_ic =
false;
3102 FLAG_concurrent_recompilation =
false;
3104 static const char* source1 =
"var error = null; "
3106 " throw new Error(); "
3110 static const char* source2 =
"var error = null; "
3112 " (function f() { f(); })(); "
3116 static const char* source3 =
"var error = null; "
3118 " throw new Error(); "
3121 " error.__proto__ = e; "
3123 static const char* source4 =
"var error = null; "
3125 " (function f() { f(); })(); "
3128 " error.__proto__ = e; "
3130 static const char* getter =
"error.stack";
3131 static const char* setter =
"error.stack = 0";
3147 i::FLAG_allow_natives_syntax =
true;
3148 i::FLAG_flush_code_incrementally =
true;
3164 CompileRun(
"function h(x) {}"
3165 "function mkClosure() {"
3166 " return function(x) { return x + 1; };"
3168 "var f = mkClosure();"
3169 "var g = mkClosure();"
3173 "%OptimizeFunctionOnNextCall(f); f(3);"
3174 "%OptimizeFunctionOnNextCall(h); h(3);");
3180 CHECK(f->is_compiled());
3181 CompileRun(
"f = null;");
3187 CHECK(g->is_compiled());
3188 const int kAgingThreshold = 6;
3189 for (
int i = 0; i < kAgingThreshold; i++) {
3190 g->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
3199 SimulateIncrementalMarking();
3200 CompileRun(
"%OptimizeFunctionOnNextCall(g); g(3);");
3204 CompileRun(
"g('bozo');");
3209 i::FLAG_allow_natives_syntax =
true;
3210 i::FLAG_flush_code_incrementally =
true;
3224 CompileRun(
"function mkClosure() {"
3225 " return function(x) { return x + 1; };"
3227 "var f = mkClosure();"
3229 "%OptimizeFunctionOnNextCall(f); f(3);");
3235 CHECK(f->is_compiled());
3236 const int kAgingThreshold = 6;
3237 for (
int i = 0; i < kAgingThreshold; i++) {
3238 f->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
3241 CompileRun(
"f = null;");
3246 SimulateIncrementalMarking();
3251 CompileRun(
"var g = mkClosure(); g('bozo');");
3256 i::FLAG_stress_compaction =
false;
3257 i::FLAG_allow_natives_syntax =
true;
3258 i::FLAG_flush_code_incrementally =
true;
3273 CompileRun(
"function f() { return 'foobar'; }"
3274 "function g(x) { if (x) f(); }"
3283 CHECK(f->is_compiled());
3284 const int kAgingThreshold = 6;
3285 for (
int i = 0; i < kAgingThreshold; i++) {
3286 f->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
3297 CompileRun(
"function flushMe() { return 0; }"
3304 CHECK(f->is_compiled());
3305 const int kAgingThreshold = 6;
3306 for (
int i = 0; i < kAgingThreshold; i++) {
3307 f->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
3314 SimulateIncrementalMarking();
3315 CHECK(shared1->code()->gc_metadata() !=
NULL);
3321 CompileRun(
"%OptimizeFunctionOnNextCall(g);"
3326 CHECK(shared1->code()->gc_metadata() ==
NULL);
3333 int space_remaining =
static_cast<int>(
3335 CHECK(space_remaining >= extra_bytes);
3336 int new_linear_size = space_remaining - extra_bytes;
3337 v8::internal::MaybeObject* maybe = space->AllocateRaw(new_linear_size);
3344 i::FLAG_allow_natives_syntax =
true;
3345 i::FLAG_crankshaft =
false;
3353 if (FLAG_gc_global || FLAG_stress_compaction)
return;
3356 CompileRun(
"function fastliteralcase(literal, value) {"
3357 " literal[0] = value;"
3360 "function get_standard_literal() {"
3361 " var literal = [1, 2, 3];"
3364 "obj = fastliteralcase(get_standard_literal(), 1);"
3365 "obj = fastliteralcase(get_standard_literal(), 1.5);"
3366 "obj = fastliteralcase(get_standard_literal(), 2);");
3370 v8_str(
"fastliteralcase(mote, 2.5);");
3392 CHECK(array->HasFastSmiOrObjectElements());
3399 CHECK(maybe_object->ToObject(&obj));
3417 i::FLAG_always_compact =
true;
3418 i::FLAG_cache_optimized_code =
false;
3419 i::FLAG_allow_natives_syntax =
true;
3420 i::FLAG_flush_code_incrementally =
true;
3436 CompileRun(
"function mkClosure() {"
3437 " return function(x) { return x + 1; };"
3439 "var f = mkClosure();"
3442 Handle<JSFunction> f =
3446 CHECK(f->is_compiled());
3447 const int kAgingThreshold = 6;
3448 for (
int i = 0; i < kAgingThreshold; i++) {
3449 f->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
3458 SimulateIncrementalMarking();
3463 CompileRun(
"%OptimizeFunctionOnNextCall(f); f(3);");
3473 i::FLAG_always_compact =
true;
3474 i::FLAG_cache_optimized_code =
false;
3475 i::FLAG_allow_natives_syntax =
true;
3476 i::FLAG_flush_code_incrementally =
true;
3492 CompileRun(
"function mkClosure() {"
3493 " return function(x) { return x + 1; };"
3495 "var f = mkClosure();"
3498 Handle<JSFunction> f =
3502 CHECK(f->is_compiled());
3503 const int kAgingThreshold = 6;
3504 for (
int i = 0; i < kAgingThreshold; i++) {
3505 f->shared()->code()->MakeOlder(static_cast<MarkingParity>(i % 2));
3514 SimulateIncrementalMarking();
3516 #ifdef ENABLE_DEBUGGER_SUPPORT
3518 CHECK(isolate->debug()->Load());
3519 #endif // ENABLE_DEBUGGER_SUPPORT
3550 delete deferred.
Detach();
3554 TEST(IncrementalMarkingStepMakesBigProgressWithLargeObjects) {
3557 CompileRun(
"function f(n) {"
3558 " var a = new Array(n);"
3559 " for (var i = 0; i < n; i += 100) a[i] = i;"
3561 "f(10 * 1024 * 1024);");
3571 i::FLAG_allow_natives_syntax =
true;
3574 CompileRun(
"function test() {"
3576 " for (var i = 0; i < 10; i++) {"
3577 " x[i] = [ {}, [1,2,3], [1,x,3] ];"
3581 " %OptimizeFunctionOnNextCall(test);"
3583 " %DeoptimizeFunction(test);"
3587 CompileRun(
"test(); test(); run();");
3591 CompileRun(
"run()");
3595 CompileRun(
"run()");
3599 CompileRun(
"run()");
3603 static int AllocationSitesCount(
Heap* heap) {
3606 !(site->IsUndefined());
3614 TEST(EnsureAllocationSiteDependentCodesProcessed) {
3615 if (i::FLAG_always_opt || !i::FLAG_crankshaft)
return;
3616 i::FLAG_allow_natives_syntax =
true;
3630 int count = AllocationSitesCount(heap);
3631 CompileRun(
"var bar = function() { return (new Array()); };"
3637 int new_count = AllocationSitesCount(heap);
3643 CompileRun(
"%OptimizeFunctionOnNextCall(bar); bar();");
3646 CHECK_GE(starts.number_of_entries(), 1);
3648 CHECK(site->dependent_code()->is_code_at(index));
3649 Code* function_bar = site->dependent_code()->code_at(index);
3654 CHECK_EQ(bar_handle->code(), function_bar);
3659 for (
int i = 0; i < 4; i++) {
3667 CHECK(!(site->dependent_code()->is_code_at(index)));
3671 TEST(CellsInOptimizedCodeAreWeak) {
3672 if (i::FLAG_always_opt || !i::FLAG_crankshaft)
return;
3673 i::FLAG_weak_embedded_objects_in_optimized_code =
true;
3674 i::FLAG_allow_natives_syntax =
true;
3686 CompileRun(
"bar = (function() {"
3690 " var foo = function(x) { with (x) { return 1 + x; } };"
3694 " %OptimizeFunctionOnNextCall(bar);"
3696 " return bar;})();");
3702 code = scope.CloseAndEscape(
Handle<Code>(bar->code()));
3706 for (
int i = 0; i < 4; i++) {
3710 ASSERT(code->marked_for_deoptimization());
3714 TEST(ObjectsInOptimizedCodeAreWeak) {
3715 if (i::FLAG_always_opt || !i::FLAG_crankshaft)
return;
3716 i::FLAG_weak_embedded_objects_in_optimized_code =
true;
3717 i::FLAG_allow_natives_syntax =
true;
3729 CompileRun(
"function bar() {"
3732 "function foo(x) { with (x) { return 1 + x; } };"
3736 "%OptimizeFunctionOnNextCall(bar);"
3743 code = scope.CloseAndEscape(
Handle<Code>(bar->code()));
3747 for (
int i = 0; i < 4; i++) {
3751 ASSERT(code->marked_for_deoptimization());
3759 "function %s() { return 0; }"
3761 "%%OptimizeFunctionOnNextCall(%s);"
3762 "%s();", name, name, name, name, name);
3763 CompileRun(source.
start());
3772 static int GetCodeChainLength(
Code* code) {
3774 while (code->next_code_link()->IsCode()) {
3783 i::FLAG_allow_natives_syntax =
true;
3792 int code_chain_length_before, code_chain_length_after;
3797 CHECK_EQ(immortal->code()->next_code_link(), mortal->code());
3798 code_chain_length_before = GetCodeChainLength(immortal->code());
3800 code = scope.CloseAndEscape(
Handle<Code>(immortal->code()));
3801 CompileRun(
"mortal = null; immortal = null;");
3805 code_chain_length_after = GetCodeChainLength(*code);
3806 CHECK_EQ(code_chain_length_before - 1, code_chain_length_after);
3815 masm.GetCode(&desc);
3819 CHECK(code->IsCode());
3825 i::FLAG_allow_natives_syntax =
true;
3840 mortal->set_next_code_link(*old_head);
3841 immortal->set_next_code_link(*mortal);
3843 new_head = scope.CloseAndEscape(immortal);
3847 CHECK_EQ(*old_head, new_head->next_code_link());
3852 TEST(AddInstructionChangesNewSpacePromotion) {
3853 i::FLAG_allow_natives_syntax =
true;
3854 i::FLAG_expose_gc =
true;
3855 i::FLAG_stress_compaction =
true;
3856 i::FLAG_gc_interval = 1000;
3858 if (!i::FLAG_allocation_site_pretenuring)
return;
3864 "function add(a, b) {"
3868 "add(\"a\", \"b\");"
3869 "var oldSpaceObject;"
3871 "function crash(x) {"
3872 " var object = {a: null, b: null};"
3873 " var result = add(1.5, x | 0);"
3874 " object.a = result;"
3875 " oldSpaceObject = object;"
3880 "%OptimizeFunctionOnNextCall(crash);"
3888 heap->set_allocation_timeout(1);
3889 g->
Call(global, 1, args1);
3894 void OnFatalErrorExpectOOM(
const char* location,
const char*
message) {
3896 exit(strcmp(location,
"CALL_AND_RETRY_LAST"));
3900 TEST(CEntryStubOOM) {
3901 i::FLAG_allow_natives_syntax =
true;
3907 "%SetFlags('--gc-interval=1');"
void ReleaseStackTraceDataTest(const char *source, const char *accessor)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter NULL
static V8_INLINE Local< T > New(Isolate *isolate, Handle< T > that)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if available(ARM only)") DEFINE_bool(enable_sudiv
static V8_INLINE Object * Cast(Value *obj)
static const int kMaxLength
static void Destroy(Object **location)
Handle< T > EscapeFrom(v8::EscapableHandleScope *scope)
Handle< JSObject > NewJSObject(Handle< JSFunction > constructor, PretenureFlag pretenure=NOT_TENURED)
void WaitUntilSweepingCompleted()
#define CHECK_EQ(expected, value)
Local< Value > Call(Handle< Value > recv, int argc, Handle< Value > argv[])
void set_size(Heap *heap, int size_in_bytes)
static FreeListNode * cast(MaybeObject *maybe)
bool Contains(Address addr)
CompilationCache * compilation_cache()
int ReservedSemiSpaceSize()
void PrintF(const char *format,...)
void SetNewSpaceHighPromotionModeActive(bool mode)
void CollectAllGarbage(int flags, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf map
bool InNewSpace(Object *object)
static TypeFeedbackInfo * cast(Object *obj)
static String * cast(Object *obj)
HandleScopeImplementer * handle_scope_implementer()
Local< Value > Get(Handle< Value > key)
static Smi * FromInt(int value)
MUST_USE_RESULT MaybeObject * CopyJSObject(JSObject *source, AllocationSite *site=NULL)
static void SetIdentityHash(Handle< JSObject > object, Handle< Smi > hash)
static HeapObject * cast(Object *obj)
static Handle< T > cast(Handle< S > that)
Handle< String > NewStringFromAscii(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
static const int kProtoTransitionElementsPerEntry
internal::Object ** limit
const int kVariableSizeSentinel
const char * data() const
static Handle< Object > SetPrototype(Handle< JSObject > object, Handle< Object > value, bool skip_hidden_prototypes=false)
Address * allocation_top_address()
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in only print modified registers Don t break for ASM_UNIMPLEMENTED_BREAK macros print stack trace when an illegal exception is thrown randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot testing_bool_flag testing_int_flag string flag tmp file in which to serialize heap Print the time it takes to lazily compile hydrogen code stubs concurrent_recompilation concurrent_sweeping Print usage message
static AllocationSite * cast(Object *obj)
Handle< JSArray > NewJSArrayWithElements(Handle< FixedArrayBase > elements, ElementsKind elements_kind, int length, PretenureFlag pretenure=NOT_TENURED)
static const int kMinimalBufferSize
static v8::Local< v8::Object > global()
Local< Value > GetHiddenValue(Handle< String > key)
static bool IsNearDeath(Object **location)
static Failure * Exception()
bool IsConcurrentSweepingInProgress()
HandleScopeData * handle_scope_data()
#define ASSERT(condition)
void Step(intptr_t allocated, CompletionAction action)
static Context * cast(Object *context)
static Local< Integer > New(Isolate *isolate, int32_t value)
Handle< Object > NewNumber(double value, PretenureFlag pretenure=NOT_TENURED)
Handle< Object > GetProperty(Handle< JSReceiver > obj, const char *name)
static const int kMaxSize
intptr_t EffectiveCapacity()
static Code * cast(Object *obj)
bool Equals(Handle< Value > that) const
Object * FindCodeObject(Address a)
static Smi * cast(Object *object)
v8::Isolate * GetIsolate()
GlobalObject * global_object()
int NotifyContextDisposed()
Handle< String > NewStringFromUtf8(Vector< const char > str, PretenureFlag pretenure=NOT_TENURED)
DeferredHandles * Detach()
void EnsureHeapIsIterable()
Handle< Map > CopyMap(Handle< Map > map, int extra_inobject_props)
Handle< JSFunction > NewFunction(Handle< String > name, Handle< Object > prototype)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object size
bool AdvanceSweeper(intptr_t bytes_to_sweep)
static SlicedString * cast(Object *obj)
static const int kProtoTransitionMapOffset
Handle< Object > Create(Object *value)
static Failure * RetryAfterGC()
void CollectAllAvailableGarbage(const char *gc_reason=NULL)
static const int kMinValue
static const int kNoGCFlags
int GetFieldIndex(int descriptor_number)
static Handle< JSObject > Copy(Handle< JSObject > object)
static void SetFatalErrorHandler(FatalErrorCallback that)
static int ContextDisposedNotification()
void Start(CompactionFlag flag=ALLOW_COMPACTION)
Object * RawFastPropertyAt(int index)
GlobalHandles * global_handles()
static Local< Script > Compile(Handle< String > source, ScriptOrigin *origin=NULL, ScriptData *script_data=NULL)
SourceResource(const char *data)
static const int kMaxRegularHeapObjectSize
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static bool IsCleared(Code *code)
static V8_INLINE Handle< T > Cast(Handle< S > that)
Handle< FixedArray > NewFixedArray(int size, PretenureFlag pretenure=NOT_TENURED)
OldSpace * old_pointer_space()
static i::Isolate * i_isolate()
static Code * GetCodeFromTargetAddress(Address address)
bool is_inline_cache_stub()
bool SetHiddenValue(Handle< String > key, Handle< Value > value)
MUST_USE_RESULT MaybeObject * AllocateJSObjectFromMap(Map *map, PretenureFlag pretenure=NOT_TENURED, bool alloc_props=true, AllocationSite *allocation_site=NULL)
InlineCacheState ic_state()
static v8::internal::Handle< To > OpenHandle(v8::Local< From > handle)
static const int kAbortIncrementalMarkingMask
Vector< const char > CStrVector(const char *data)
bool CollectGarbage(AllocationSpace space, const char *gc_reason=NULL, const GCCallbackFlags gc_callback_flags=kNoGCCallbackFlags)
MUST_USE_RESULT MaybeObject * GetProperty(Name *key)
V8_INLINE P * GetParameter() const
int StrLength(const char *string)
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
bool use_crankshaft() const
static Local< Object > New(Isolate *isolate)
static int SizeFor(int length)
static Handle< Object > SetElement(Handle< JSReceiver > object, uint32_t index, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode)
static const int kProtoTransitionHeaderSize
Handle< String > NewProperSubString(Handle< String > str, int begin, int end)
static const int kHeaderSize
static Local< Context > New(Isolate *isolate, ExtensionConfiguration *extensions=NULL, Handle< ObjectTemplate > global_template=Handle< ObjectTemplate >(), Handle< Value > global_object=Handle< Value >())
static int SNPrintF(Vector< char > str, const char *format,...)
MUST_USE_RESULT MaybeObject * NumberFromDouble(double value, PretenureFlag pretenure=NOT_TENURED)
Vector< const uint8_t > OneByteVector(const char *data, int length)
MUST_USE_RESULT MaybeObject * CreateCode(const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false, bool crankshafted=false, int prologue_offset=Code::kPrologueOffsetNotSet)
static void Initialize(Handle< JSArray > array, int capacity, int length=0)
int InitialSemiSpaceSize()
static Handle< Object > SetElementsLength(Handle< JSArray > array, Handle< Object > length)
Handle< String > InternalizeOneByteString(Vector< const uint8_t > str)
static void InitializeVM()
static ObjectHashTable * cast(Object *obj)
static Handle< Object > UninitializedSentinel(Isolate *isolate)
static Handle< Object > SetProperty(Handle< JSReceiver > object, Handle< Name > key, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
Handle< T > handle(T *t, Isolate *isolate)
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function info
#define OBJECT_POINTER_ALIGN(value)
void set_should_hurry(bool val)
Object * native_contexts_list()
static Object * cast(Object *value)
MUST_USE_RESULT MaybeObject * NumberFromUint32(uint32_t value, PretenureFlag pretenure=NOT_TENURED)
IncrementalMarking * incremental_marking()
void EnableInlineAllocation()
static Flags ComputeFlags(Kind kind, InlineCacheState ic_state=UNINITIALIZED, ExtraICState extra_ic_state=kNoExtraICState, StubType type=NORMAL, InlineCacheHolderFlag holder=OWN_MAP)
static Local< String > NewExternal(Isolate *isolate, ExternalStringResource *resource)
static void MakeWeak(Object **location, void *parameter, WeakCallback weak_callback)
Handle< String > InternalizeUtf8String(Vector< const char > str)
void Iterate(v8::internal::ObjectVisitor *v)
Handle< Code > NewCode(const CodeDesc &desc, Code::Flags flags, Handle< Object > self_reference, bool immovable=false, bool crankshafted=false, int prologue_offset=Code::kPrologueOffsetNotSet)
void VisitPointers(Object **start, Object **end)
static const int kProtoTransitionPrototypeOffset
static Handle< Map > GetPrototypeTransition(Handle< Map > map, Handle< Object > prototype)
InstanceType instance_type()
MUST_USE_RESULT MaybeObject * AllocateFixedArray(int length, PretenureFlag pretenure=NOT_TENURED)
static FixedArray * cast(Object *obj)
MUST_USE_RESULT MaybeObject * InternalizeUtf8String(const char *str)
static const int kHeaderSize
void DisableInlineAllocation()
MUST_USE_RESULT MaybeObject * NumberFromInt32(int32_t value, PretenureFlag pretenure=NOT_TENURED)
static Handle< Object > GetElement(Isolate *isolate, Handle< Object > object, uint32_t index)
void CreateFillerObjectAt(Address addr, int size)
char * StrDup(const char *str)
Address * allocation_limit_address()
static Handle< Object > DeleteProperty(Handle< JSReceiver > object, Handle< Name > name, DeleteMode mode=NORMAL_DELETION)
void DeleteArray(T *array)
Handle< Map > NewMap(InstanceType type, int instance_size, ElementsKind elements_kind=TERMINAL_FAST_ELEMENTS_KIND)
static const int kMaxValue
enable upcoming ES6 features enable harmony block scoping enable harmony enable harmony proxies enable harmony generators enable harmony numeric enable harmony string enable harmony math functions harmony_scoping harmony_symbols harmony_collections harmony_iteration harmony_strings harmony_scoping harmony_maths tracks arrays with only smi values Optimize object Array DOM strings and string pretenure call new trace pretenuring decisions of HAllocate instructions track fields with only smi values track fields with heap values track_fields track_fields Enables optimizations which favor memory size over execution speed use string slices optimization filter maximum number of GVN fix point iterations use function inlining use allocation folding eliminate write barriers targeting allocations in optimized code maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining crankshaft harvests type feedback from stub cache trace check elimination phase hydrogen tracing filter trace hydrogen to given file name trace inlining decisions trace store elimination trace all use positions trace global value numbering trace hydrogen escape analysis trace the tracking of allocation sites trace map generalization environment for every instruction deoptimize every n garbage collections put a break point before deoptimizing deoptimize uncommon cases use on stack replacement trace array bounds check elimination perform array index dehoisting use load elimination use store elimination use constant folding eliminate unreachable code number of stress runs when picking a function to watch for shared function not JSFunction itself flushes the cache of optimized code for closures on every GC functions with arguments object maximum number of escape analysis fix point iterations allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms concurrent on stack replacement do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes number of stack frames inspected by the profiler percentage of ICs that must have type info to allow optimization extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long expose natives in global object expose freeBuffer extension expose gc extension under the specified name expose externalize string extension number of stack frames to capture disable builtin natives files print name of functions for which code is generated use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations always try to OSR functions trace optimize function deoptimization minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions trace debugging JSON request response trace out of bounds accesses to external arrays trace_js_array_abuse automatically set the debug break flag when debugger commands are in the queue abort by crashing maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print statistics of the maximum memory committed for the heap in name
static Handle< Object > ToString(Isolate *isolate, Handle< Object > obj, bool *exc)
Handle< Object > NewNumberFromUint(uint32_t value, PretenureFlag pretenure=NOT_TENURED)
MUST_USE_RESULT MaybeObject * AllocateRaw(int size_in_bytes, AllocationSpace space, AllocationSpace retry_space)
Object * allocation_sites_list()
FixedArray * GetPrototypeTransitions()
static JSObject * cast(Object *obj)
Handle< JSArray > NewJSArray(ElementsKind elements_kind, int length, int capacity, ArrayStorageAllocationMode mode=INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE, PretenureFlag pretenure=NOT_TENURED)
MarkCompactCollector * mark_compact_collector()
int CountNativeContexts()
Handle< T > CloseAndEscape(Handle< T > handle_value)
static v8::Isolate * isolate()
static bool IdleNotification(int hint=1000)
static bool HasLocalProperty(Handle< JSReceiver >, Handle< Name > name)
static JSFunction * cast(Object *obj)