15 #include "../include/v8-profiler.h"
19 class NamedEntriesDetector {
21 NamedEntriesDetector()
25 void CheckEntry(i::HeapEntry* entry) {
26 if (strcmp(entry->name(),
"A2") == 0) has_A2 =
true;
27 if (strcmp(entry->name(),
"B2") == 0) has_B2 =
true;
28 if (strcmp(entry->name(),
"C2") == 0) has_C2 =
true;
31 static bool AddressesMatch(
void* key1,
void* key2) {
35 void CheckAllReachables(i::HeapEntry* root) {
40 while (!list.is_empty()) {
41 i::HeapEntry* entry = list.RemoveLast();
43 for (
int i = 0; i < children.
length(); ++i) {
44 if (children[i]->type() == i::HeapGraphEdge::kShortcut)
continue;
45 i::HeapEntry* child = children[i]->to();
46 i::HashMap::Entry* entry = visited.Lookup(
47 reinterpret_cast<void*>(child),
48 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(child)),
52 entry->value =
reinterpret_cast<void*
>(1);
72 CHECK_EQ(0, strncmp(
"Object", const_cast<i::HeapEntry*>(
73 reinterpret_cast<const i::HeapEntry*>(global_obj))->name(), 6));
84 if (prop->
GetType() == type && strcmp(name, *prop_name) == 0)
97 if (strcmp(contents, *node_name) == 0)
return true;
110 "function B2(x) { return function() { return typeof x; }; }\n"
111 "function C2(x) { this.x1 = x; this.x2 = x; this[1] = x; }\n"
112 "var a2 = new A2();\n"
113 "var b2_1 = new B2(a2), b2_2 = new B2(a2);\n"
114 "var c2 = new C2(a2);");
129 NamedEntriesDetector det;
130 det.CheckAllReachables(const_cast<i::HeapEntry*>(
131 reinterpret_cast<const i::HeapEntry*>(global_env2)));
138 TEST(HeapSnapshotObjectSizes) {
145 "function X(a, b) { this.a = a; this.b = b; }\n"
146 "x = new X(new X(), new X());\n"
148 "(function() { x.a.a = x.b; })();");
169 TEST(BoundFunctionInSnapshot) {
173 "function myFunction(a, b) { this.a = a; this.b = b; }\n"
174 "function AAAAA() {}\n"
175 "boundFunction = myFunction.bind(new AAAAA(), 20, new Number(12)); \n");
187 CHECK_EQ(4, bindings->GetChildrenCount());
196 CHECK(bound_function);
201 CHECK(bound_argument);
206 TEST(HeapSnapshotEntryChildren) {
230 TEST(HeapSnapshotCodeObjects) {
235 "function lazy(x) { return x - 1; }\n"
236 "function compiled(x) { return x + 1; }\n"
237 "var anonymous = (function() { return function() { return 0; } })();\n"
269 bool compiled_references_x =
false, lazy_references_x =
false;
270 for (
int i = 0, count = compiled_code->
GetChildrenCount(); i < count; ++i) {
274 if (HasString(node,
"x")) {
275 compiled_references_x =
true;
284 if (HasString(node,
"x")) {
285 lazy_references_x =
true;
290 CHECK(compiled_references_x);
291 CHECK(!lazy_references_x);
295 TEST(HeapSnapshotHeapNumbers) {
299 "a = 1; // a is Smi\n"
300 "b = 2.5; // b is HeapNumber");
311 TEST(HeapSnapshotSlicedString) {
315 "parent_string = \"123456789.123456789.123456789.123456789.123456789."
316 "123456789.123456789.123456789.123456789.123456789."
317 "123456789.123456789.123456789.123456789.123456789."
318 "123456789.123456789.123456789.123456789.123456789.\";"
319 "child_string = parent_string.slice(100);");
334 TEST(HeapSnapshotInternalReferences) {
358 #define CHECK_EQ_SNAPSHOT_OBJECT_ID(a, b) \
359 CHECK_EQ(static_cast<int32_t>(a), static_cast<int32_t>(b))
360 #define CHECK_NE_SNAPSHOT_OBJECT_ID(a, b) \
361 CHECK((a) != (b)) // NOLINT
363 TEST(HeapEntryIdsAndArrayShift) {
368 "function AnObject() {\n"
369 " this.first = 'first';\n"
370 " this.second = 'second';\n"
372 "var a = new Array();\n"
373 "for (var i = 0; i < 10; ++i)\n"
374 " a.push(new AnObject());\n");
379 "for (var i = 0; i < 1; ++i)\n"
415 "function B(x) { this.x = x; }\n"
417 "var b = new B(a);");
471 TEST(HeapSnapshotRootPreservedAfterSorting) {
488 TestJSONStream() : eos_signaled_(0), abort_countdown_(-1) {}
489 explicit TestJSONStream(
int abort_countdown)
490 : eos_signaled_(0), abort_countdown_(abort_countdown) {}
491 virtual ~TestJSONStream() {}
494 if (abort_countdown_ > 0) --abort_countdown_;
495 if (abort_countdown_ == 0)
return kAbort;
498 memcpy(chunk.
start(), buffer, chars_written);
501 virtual WriteResult WriteUint32Chunk(uint32_t* buffer,
int chars_written) {
506 int eos_signaled() {
return eos_signaled_; }
507 int size() {
return buffer_.size(); }
512 int abort_countdown_;
518 length_ =
string.length();
520 virtual const char*
data()
const {
return data_; }
521 virtual size_t length()
const {
return length_; }
529 TEST(HeapSnapshotJSONSerialization) {
533 #define STRING_LITERAL_FOR_TEST \
534 "\"String \\n\\r\\u0008\\u0081\\u0101\\u0801\\u8001\""
536 "function A(s) { this.s = s; }\n"
537 "function B(x) { this.x = x; }\n"
539 "var b = new B(a);");
542 TestJSONStream stream;
547 stream.WriteTo(json);
550 AsciiResource json_res(json);
552 env->
Global()->Set(v8_str(
"json_snapshot"), json_string);
554 "var parsed = JSON.parse(json_snapshot); true;");
559 env->
Global()->Get(v8_str(
"parsed"))->ToObject();
560 CHECK(parsed_snapshot->Has(v8_str(
"snapshot")));
561 CHECK(parsed_snapshot->Has(v8_str(
"nodes")));
562 CHECK(parsed_snapshot->Has(v8_str(
"edges")));
563 CHECK(parsed_snapshot->Has(v8_str(
"strings")));
567 "var meta = parsed.snapshot.meta;\n"
568 "var edge_count_offset = meta.node_fields.indexOf('edge_count');\n"
569 "var node_fields_count = meta.node_fields.length;\n"
570 "var edge_fields_count = meta.edge_fields.length;\n"
571 "var edge_type_offset = meta.edge_fields.indexOf('type');\n"
572 "var edge_name_offset = meta.edge_fields.indexOf('name_or_index');\n"
573 "var edge_to_node_offset = meta.edge_fields.indexOf('to_node');\n"
574 "var property_type ="
575 " meta.edge_types[edge_type_offset].indexOf('property');\n"
576 "var shortcut_type ="
577 " meta.edge_types[edge_type_offset].indexOf('shortcut');\n"
578 "var node_count = parsed.nodes.length / node_fields_count;\n"
579 "var first_edge_indexes = parsed.first_edge_indexes = [];\n"
580 "for (var i = 0, first_edge_index = 0; i < node_count; ++i) {\n"
581 " first_edge_indexes[i] = first_edge_index;\n"
582 " first_edge_index += edge_fields_count *\n"
583 " parsed.nodes[i * node_fields_count + edge_count_offset];\n"
585 CHECK(!meta_analysis_result.IsEmpty());
589 "function GetChildPosByProperty(pos, prop_name, prop_type) {\n"
590 " var nodes = parsed.nodes;\n"
591 " var edges = parsed.edges;\n"
592 " var strings = parsed.strings;\n"
593 " var node_ordinal = pos / node_fields_count;\n"
594 " for (var i = parsed.first_edge_indexes[node_ordinal],\n"
595 " count = parsed.first_edge_indexes[node_ordinal + 1];\n"
596 " i < count; i += edge_fields_count) {\n"
597 " if (edges[i + edge_type_offset] === prop_type\n"
598 " && strings[edges[i + edge_name_offset]] === prop_name)\n"
599 " return edges[i + edge_to_node_offset];\n"
605 "GetChildPosByProperty(\n"
606 " GetChildPosByProperty(\n"
607 " GetChildPosByProperty("
608 " parsed.edges[edge_to_node_offset],"
609 " \"b\", property_type),\n"
610 " \"x\", property_type),"
611 " \"s\", property_type)");
614 static_cast<int>(string_obj_pos_val->
ToNumber()->Value());
616 parsed_snapshot->Get(v8_str(
"nodes"))->ToObject();
617 int string_index =
static_cast<int>(
618 nodes_array->
Get(string_obj_pos + 1)->ToNumber()->Value());
621 parsed_snapshot->Get(v8_str(
"strings"))->ToObject();
625 #undef STRING_LITERAL_FOR_TEST
631 TEST(HeapSnapshotJSONSerializationAborting) {
636 TestJSONStream stream(5);
652 first_interval_index_(-1) { }
653 TestStatsStream(
const TestStatsStream& stream)
654 : v8::OutputStream(stream),
655 eos_signaled_(stream.eos_signaled_),
656 updates_written_(stream.updates_written_),
657 entries_count_(stream.entries_count_),
658 entries_size_(stream.entries_size_),
659 intervals_count_(stream.intervals_count_),
660 first_interval_index_(stream.first_interval_index_) { }
661 virtual ~TestStatsStream() {}
668 int updates_written) {
671 updates_written_ += updates_written;
673 if (first_interval_index_ == -1 && updates_written != 0)
674 first_interval_index_ = buffer[0].
index;
675 for (
int i = 0; i < updates_written; ++i) {
676 entries_count_ += buffer[i].
count;
677 entries_size_ += buffer[i].
size;
682 int eos_signaled() {
return eos_signaled_; }
683 int updates_written() {
return updates_written_; }
684 uint32_t entries_count()
const {
return entries_count_; }
685 uint32_t entries_size()
const {
return entries_size_; }
686 int intervals_count()
const {
return intervals_count_; }
687 int first_interval_index()
const {
return first_interval_index_; }
691 int updates_written_;
692 uint32_t entries_count_;
693 uint32_t entries_size_;
694 int intervals_count_;
695 int first_interval_index_;
700 static TestStatsStream GetHeapStatsUpdate(
702 TestStatsStream stream;
706 *object_id = last_seen_id;
712 TEST(HeapSnapshotObjectsStats) {
719 for (
int i = 0; i < 6; ++i) {
726 TestStatsStream stats_update = GetHeapStatsUpdate(&initial_id);
727 CHECK_EQ(1, stats_update.intervals_count());
728 CHECK_EQ(1, stats_update.updates_written());
729 CHECK_LT(0, stats_update.entries_size());
730 CHECK_EQ(0, stats_update.first_interval_index());
735 CHECK_EQ(0, GetHeapStatsUpdate(&same_id).updates_written());
744 TestStatsStream stats_update = GetHeapStatsUpdate(&additional_string_id);
745 CHECK_LT(same_id, additional_string_id);
746 CHECK_EQ(1, stats_update.intervals_count());
747 CHECK_EQ(1, stats_update.updates_written());
748 CHECK_LT(0, stats_update.entries_size());
749 CHECK_EQ(1, stats_update.entries_count());
750 CHECK_EQ(2, stats_update.first_interval_index());
755 CHECK_EQ(0, GetHeapStatsUpdate(&last_id).updates_written());
762 uint32_t entries_size;
770 TestStatsStream stats_update = GetHeapStatsUpdate();
771 CHECK_EQ(1, stats_update.intervals_count());
772 CHECK_EQ(1, stats_update.updates_written());
773 CHECK_LT(0, entries_size = stats_update.entries_size());
774 CHECK_EQ(3, stats_update.entries_count());
775 CHECK_EQ(4, stats_update.first_interval_index());
781 TestStatsStream stats_update = GetHeapStatsUpdate();
782 CHECK_EQ(1, stats_update.intervals_count());
783 CHECK_EQ(1, stats_update.updates_written());
784 CHECK_GT(entries_size, stats_update.entries_size());
785 CHECK_EQ(1, stats_update.entries_count());
787 CHECK_EQ(4, stats_update.first_interval_index());
793 TestStatsStream stats_update = GetHeapStatsUpdate();
794 CHECK_EQ(1, stats_update.intervals_count());
795 CHECK_EQ(1, stats_update.updates_written());
796 CHECK_EQ(0, stats_update.entries_size());
797 CHECK_EQ(0, stats_update.entries_count());
799 CHECK_EQ(4, stats_update.first_interval_index());
804 TestStatsStream stats_update = GetHeapStatsUpdate();
805 CHECK_EQ(1, stats_update.intervals_count());
806 CHECK_EQ(1, stats_update.updates_written());
807 CHECK_EQ(0, stats_update.entries_size());
808 CHECK_EQ(0, stats_update.entries_count());
810 CHECK_EQ(2, stats_update.first_interval_index());
816 array->
Set(2, v8_num(7));
818 uint32_t entries_size;
821 TestStatsStream stats_update = GetHeapStatsUpdate();
822 CHECK_EQ(1, stats_update.intervals_count());
823 CHECK_EQ(1, stats_update.updates_written());
824 CHECK_LT(0, entries_size = stats_update.entries_size());
826 CHECK_EQ(2, stats_update.entries_count());
827 CHECK_EQ(8, stats_update.first_interval_index());
830 for (
int i = 0; i < 100; ++i)
831 array->
Set(i, v8_num(i));
835 TestStatsStream stats_update = GetHeapStatsUpdate();
836 CHECK_EQ(1, stats_update.intervals_count());
839 CHECK_EQ(2, stats_update.updates_written());
840 CHECK_LT(entries_size, stats_update.entries_size());
841 CHECK_EQ(2, stats_update.entries_count());
842 CHECK_EQ(8, stats_update.first_interval_index());
851 int level,
int max_level) {
852 if (level > max_level)
return;
860 CheckChildrenIds(snapshot, child, level + 1, max_level);
865 TEST(HeapSnapshotGetNodeById) {
872 CheckChildrenIds(snapshot, root, 0, 3);
878 TEST(HeapSnapshotGetSnapshotObjectId) {
881 CompileRun(
"globalObject = {};\n");
887 CHECK(global_object);
902 TEST(HeapSnapshotUnknownSnapshotObjectId) {
905 CompileRun(
"globalObject = {};\n");
918 explicit TestActivityControl(
int abort_count)
919 : done_(0), total_(0), abort_count_(abort_count) {}
923 return --abort_count_ != 0 ? kContinue :
kAbort;
925 int done() {
return done_; }
926 int total() {
return total_; }
935 TEST(TakeHeapSnapshotAborting) {
940 TestActivityControl aborting_control(1);
947 CHECK_GT(aborting_control.total(), aborting_control.done());
949 TestActivityControl control(-1);
956 CHECK_EQ(control.total(), control.done());
966 const char* group_label,
968 intptr_t element_count = -1,
972 group_label_(group_label),
974 element_count_(element_count),
984 return GetHash() == other->GetHash();
986 virtual intptr_t
GetHash() {
return hash_; }
988 virtual const char*
GetLabel() {
return label_; }
991 bool disposed() {
return disposed_; }
998 if (strcmp(*ascii,
"AAA") == 0)
1000 else if (strcmp(*ascii,
"BBB") == 0)
1003 }
else if (class_id == 2) {
1006 if (strcmp(*ascii,
"CCC") == 0)
1020 const char* group_label_;
1022 intptr_t element_count_;
1036 if (node->
GetType() == type && strcmp(name,
1037 const_cast<i::HeapEntry*>(
1038 reinterpret_cast<const i::HeapEntry*>(node))->name()) == 0) {
1046 TEST(HeapSnapshotRetainedObjectInfo) {
1051 1, TestRetainedObjectInfo::WrapperInfoCallback);
1053 2, TestRetainedObjectInfo::WrapperInfoCallback);
1063 CHECK_EQ(0, TestRetainedObjectInfo::instances.length());
1067 CHECK_EQ(3, TestRetainedObjectInfo::instances.length());
1068 for (
int i = 0; i < TestRetainedObjectInfo::instances.length(); ++i) {
1069 CHECK(TestRetainedObjectInfo::instances[i]->disposed());
1070 delete TestRetainedObjectInfo::instances[i];
1080 CHECK_EQ(2, aaa->GetChildrenCount());
1094 CHECK_EQ(1, ccc->GetChildrenCount());
1114 (*env)->Global()->Set(v8_str(
"root_object"), objects_[0]);
1121 instance_->AddImplicitReferences();
1125 void AddImplicitReferences() {
1141 TEST(HeapSnapshotImplicitReferences) {
1159 int implicit_targets_count = 0;
1160 for (
int i = 0, count = obj1->GetChildrenCount(); i < count; ++i) {
1164 strcmp(
"native", *prop_name) == 0) {
1165 ++implicit_targets_count;
1168 CHECK_EQ(2, implicit_targets_count);
1201 unsigned uid1 = s1->
GetUid();
1211 unsigned uid2 = s2->
GetUid();
1212 CHECK_NE(static_cast<int>(uid1), static_cast<int>(uid2));
1218 unsigned uid3 = s3->
GetUid();
1219 CHECK_NE(static_cast<int>(uid1), static_cast<int>(uid3));
1235 CompileRun(
"document = { URL:\"abcdefgh\" };");
1242 const_cast<i::HeapEntry*>(
1243 reinterpret_cast<const i::HeapEntry*>(global))->name());
1252 "this.__defineGetter__(\"document\", function() { throw new Error(); })");
1258 const_cast<i::HeapEntry*>(
1259 reinterpret_cast<const i::HeapEntry*>(global))->name());
1268 "function URLWithException() {}\n"
1269 "URLWithException.prototype = { get URL() { throw new Error(); } };\n"
1270 "document = { URL: new URLWithException() };");
1276 const_cast<i::HeapEntry*>(
1277 reinterpret_cast<const i::HeapEntry*>(global))->name());
1285 CompileRun(
"document = { URL:\"abcdefgh\" };");
1291 CHECK_EQ(count_before, count_after);
1305 for (
int i = 0; i < nodes_count; ++i) {
1306 if (snapshot->
GetNode(i) == global)
1317 CompileRun(
"a = { s_prop: \'value\', n_prop: 0.1 };");
1327 CHECK(obj->GetHeapValue()->IsObject());
1329 CHECK(js_obj == obj->GetHeapValue());
1334 CHECK(js_s_prop == s_prop->GetHeapValue());
1339 CHECK(js_n_prop == n_prop->GetHeapValue());
1343 TEST(GetHeapValueForDeletedObject) {
1350 CompileRun(
"a = { p: { r: {} } };");
1364 CompileRun(
"delete a.p;");
1369 static int StringCmp(
const char* ref,
i::String* act) {
1371 int result = strcmp(ref, *s_act);
1373 fprintf(stderr,
"Expected: \"%s\", Actual: \"%s\"\n", ref, *s_act);
1383 "function Constructor1() {};\n"
1384 "var obj1 = new Constructor1();\n"
1385 "var Constructor2 = function() {};\n"
1386 "var obj2 = new Constructor2();\n"
1388 "obj3.constructor = function Constructor3() {};\n"
1390 "// Slow properties\n"
1391 "for (var i=0; i<2000; ++i) obj4[\"p\" + i] = i;\n"
1392 "obj4.constructor = function Constructor4() {};\n"
1395 "obj6.constructor = 6;");
1429 CompileRun(
"var obj1 = {};\n"
1430 "obj1.__defineGetter__('propWithGetter', function Y() {\n"
1433 "obj1.__defineSetter__('propWithSetter', function Z(value) {\n"
1434 " return this.value_ = value;\n"
1457 "function C(x) { this.a = this; this.b = x; }\n"
1458 "c = new C(2012);\n");
1471 cHandle->
ToObject()->SetHiddenValue(v8_str(
"key"), v8_str(
"val"));
1474 v8_str(
"HiddenPropertiesFastCase2"));
1475 global = GetGlobalObject(snapshot);
1479 "hidden_properties");
1548 "fun = (function (x) { return function () { return x + 1; } })(1);");
1562 #ifdef ENABLE_DEBUGGER_SUPPORT
1563 TEST(NoDebugObjectInSnapshot) {
1567 v8::internal::Isolate::Current()->debug()->Load();
1568 CompileRun(
"foo = {};");
1572 int globals_count = 0;
1585 #endif // ENABLE_DEBUGGER_SUPPORT
1626 CompileRun(
"foo = {};");
1639 CHECK(isalpha(**name));
1644 TEST(NoRefsToNonEssentialEntries) {
1647 CompileRun(
"global_object = {};\n");
1663 TEST(MapHasDescriptorsAndTransitions) {
1666 CompileRun(
"obj = { a: 10 };\n");
void MakeWeak(void *parameters, WeakReferenceCallback callback)
static void DeleteAllSnapshots()
const HeapGraphEdge * GetChild(int index) const
static int NumberOfHandles()
#define CHECK_EQ(expected, value)
static const HeapSnapshot * TakeSnapshot(Handle< String > title, HeapSnapshot::Type type=HeapSnapshot::kFull, ActivityControl *control=NULL)
const HeapGraphNode * GetFromNode() const
virtual intptr_t GetHash()=0
V8EXPORT Local< Value > Get(Handle< Value > key)
Handle< Value > GetName() const
GraphWithImplicitRefs(LocalContext *env)
Handle< String > GetName() const
SnapshotObjectId GetId() const
static V8EXPORT Local< String > New(const char *data, int length=-1)
const HeapGraphNode * GetNodeById(SnapshotObjectId id) const
const HeapGraphNode * GetNode(int index) const
#define ASSERT(condition)
V8EXPORT Local< Number > ToNumber() const
static int GetSnapshotsCount()
static void DefineWrapperClass(uint16_t class_id, WrapperInfoCallback callback)
AsciiResource(Vector< const char > string)
StringInputBuffer *const buffer_
Handle< Object > GetProperty(Handle< JSReceiver > obj, const char *name)
virtual ControlOption ReportProgressValue(int done, int total)=0
V8EXPORT void SetInternalField(int index, Handle< Value > value)
SmartArrayPointer< char > ToCString(AllowNullsFlag allow_nulls, RobustnessFlag robustness_flag, int offset, int length, int *length_output=0)
V8EXPORT int InternalFieldCount()
int GetChildrenCount() const
virtual bool IsEquivalent(RetainedObjectInfo *other)=0
static const HeapSnapshot * FindSnapshot(unsigned uid)
static Local< ObjectTemplate > New()
static void StopHeapObjectsTracking()
SnapshotObjectId GetMaxSnapshotJSObjectId() const
V8EXPORT Local< Value > GetPrototype()
static String * GetConstructorName(JSObject *object)
virtual const char * GetLabel()=0
static const int kNoGCFlags
void SetInternalFieldCount(int value)
static SnapshotObjectId PushHeapObjectsStats(OutputStream *stream)
virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate *data, int count)
#define STRING_LITERAL_FOR_TEST
void SetWrapperClassId(uint16_t class_id)
static Persistent< T > New(Handle< T > that)
activate correct semantics for inheriting readonliness false
static const int kObjectsCount
#define CHECK_NE(unexpected, value)
V8EXPORT bool IsObject() const
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit 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 SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting 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 more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the snapshot(mksnapshot only)") DEFINE_bool(help
virtual WriteResult WriteAsciiChunk(char *data, int size)=0
virtual size_t length() const =0
List< HeapEntry * > * GetSortedEntriesList()
uint32_t SnapshotObjectId
int GetNodesCount() const
virtual const char * data() const =0
const HeapGraphNode * GetRoot() const
virtual intptr_t GetElementCount()
static void SetGlobalGCPrologueCallback(GCCallback)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit 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 SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available 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 MIPS FPU instructions if NULL
static int GetPersistentHandleCount()
Handle< Value > GetHeapValue() const
bool HasWeakEdge(const v8::HeapGraphNode *node)
V8EXPORT Local< Object > ToObject() const
V8EXPORT uint32_t Length() const
virtual void EndOfStream()=0
static void StartHeapObjectsTracking()
#define CHECK_NE_SNAPSHOT_OBJECT_ID(a, b)
static V8EXPORT Local< String > NewExternal(ExternalStringResource *resource)
#define CHECK_EQ_SNAPSHOT_OBJECT_ID(a, b)
virtual intptr_t GetSizeInBytes()
static SnapshotObjectId GetSnapshotObjectId(Handle< Value > value)
const HeapGraphNode * GetToNode() const
bool HasWeakGlobalHandle()
void Serialize(OutputStream *stream, SerializationFormat format) const
static void AddImplicitReferences(Persistent< Object > parent, Persistent< Value > *children, size_t length)
virtual const char * GetGroupLabel()
static V8EXPORT Local< Object > New()
static const SnapshotObjectId kUnknownObjectId
V8EXPORT bool Set(Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)