61 ThreadLocalTop::ThreadLocalTop() {
66 void ThreadLocalTop::InitializeInternal() {
73 external_callback_scope_ =
NULL;
75 try_catch_handler_ =
NULL;
78 external_caught_exception_ =
false;
79 failed_access_check_callback_ =
NULL;
82 top_lookup_result_ =
NULL;
83 promise_on_stack_ =
NULL;
87 pending_exception_ =
NULL;
88 has_pending_message_ =
false;
89 rethrowing_message_ =
false;
90 pending_message_obj_ =
NULL;
91 pending_message_script_ =
NULL;
92 scheduled_exception_ =
NULL;
96 void ThreadLocalTop::Initialize() {
99 simulator_ = Simulator::current(isolate_);
107 while (promise_on_stack_) isolate_->PopPromise();
118 Isolate::PerIsolateThreadData*
125 if (per_thread ==
NULL) {
168 ThreadLocalTop* thread =
reinterpret_cast<ThreadLocalTop*
>(thread_storage);
170 return thread_storage +
sizeof(ThreadLocalTop);
175 ThreadLocalTop* thread =
reinterpret_cast<ThreadLocalTop*
>(t);
182 v->VisitPointer(&thread->pending_exception_);
183 v->VisitPointer(&(thread->pending_message_obj_));
184 v->VisitPointer(bit_cast<Object**>(&(thread->pending_message_script_)));
185 v->VisitPointer(bit_cast<Object**>(&(thread->context_)));
186 v->VisitPointer(&thread->scheduled_exception_);
190 block = block->next_) {
191 v->VisitPointer(bit_cast<Object**>(&(block->exception_)));
192 v->VisitPointer(bit_cast<Object**>(&(block->message_obj_)));
193 v->VisitPointer(bit_cast<Object**>(&(block->message_script_)));
198 it.frame()->Iterate(v);
202 thread->top_lookup_result_->Iterate(v);
215 deferred = deferred->next_) {
216 deferred->Iterate(visitor);
231 deferred = deferred->next_) {
233 for (
int i = 0;
i < blocks->length();
i++) {
234 Object** block_limit = (
i == 0) ? deferred->first_block_limit_
259 HeapStringAllocator allocator;
260 StringStream::ClearMentionedObjectCache(
this);
261 StringStream accumulator(&allocator);
271 "\n\nAttempt to print stack while printing stack (double fault)\n");
273 "If you are lucky you may find a partial stack dump on stdout.\n\n");
275 return factory()->empty_string();
279 return factory()->empty_string();
284 void Isolate::PushStackTraceAndDie(
unsigned int magic,
287 unsigned int magic2) {
288 const int kMaxStackTraceSize = 8192;
290 uint8_t buffer[kMaxStackTraceSize];
291 int length =
Min(kMaxStackTraceSize - 1, trace->length());
293 buffer[length] =
'\0';
296 static_cast<void*
>(
object),
static_cast<void*
>(
map),
297 reinterpret_cast<char*
>(buffer));
312 if ((fun == caller) && !(*seen_caller)) {
317 if (!(*seen_caller))
return false;
323 if (!FLAG_builtins_in_stack_traces) {
324 if (receiver->IsJSBuiltinsObject())
return false;
326 return fun->shared()->native();
340 if (!error->IsJSObject())
return factory()->undefined_value();
343 factory()->InternalizeUtf8String(
"stackTraceLimit");
348 if (!stack_trace_limit->IsNumber())
return factory()->undefined_value();
350 limit =
Max(limit, 0);
352 int initial_size =
Min(limit, 10);
354 factory()->NewFixedArrayWithHoles(initial_size * 4 + 1);
358 bool seen_caller = !caller->IsJSFunction();
362 int sloppy_frames = 0;
363 bool encountered_strict_function =
false;
364 for (JavaScriptFrameIterator iter(
this);
365 !iter.done() && frames_seen < limit;
372 for (
int i = frames.length() - 1;
i >= 0;
i--) {
378 if (!this->
context()->HasSameSecurityTokenAs(fun->context()))
continue;
379 if (cursor + 4 > elements->length()) {
382 factory()->NewFixedArrayWithHoles(new_capacity);
383 for (
int i = 0;
i < cursor;
i++) {
384 new_elements->set(
i, elements->get(
i));
386 elements = new_elements;
388 DCHECK(cursor + 4 <= elements->length());
397 if (!encountered_strict_function) {
398 if (fun->shared()->strict_mode() ==
STRICT) {
399 encountered_strict_function =
true;
404 elements->set(cursor++, *recv);
405 elements->set(cursor++, *fun);
406 elements->set(cursor++, *code);
407 elements->set(cursor++, *offset);
442 int limit =
Max(frame_limit, 0);
454 factory()->InternalizeOneByteString(
465 while (!it.done() && (frames_seen < limit)) {
471 for (
int i = frames.length() - 1;
i >= 0 && frames_seen < limit;
i--) {
475 !this->
context()->HasSameSecurityTokenAs(fun->context()))
continue;
483 int script_line_offset = script->line_offset()->value();
484 int position = frames[
i].code()->SourcePosition(frames[
i].
pc());
487 int relative_line_number = line_number - script_line_offset;
490 int start = (relative_line_number == 0) ? 0 :
491 Smi::cast(line_ends->get(relative_line_number - 1))->value() + 1;
492 int column_offset = position - start;
493 if (relative_line_number == 0) {
496 column_offset += script->column_offset()->value();
499 stack_frame, column_key,
503 stack_frame, line_key,
509 stack_frame, script_id_key,
handle(script->id(),
this),
NONE);
514 stack_frame, script_name_key,
handle(script->name(),
this),
NONE);
520 stack_frame, script_name_or_source_url_key, result,
NONE);
539 stack_frame, constructor_key, is_constructor,
NONE);
542 FixedArray::cast(stack_trace->elements())->set(frames_seen, *stack_frame);
556 StringStream::ClearMentionedObjectCache(
this);
557 HeapStringAllocator allocator;
558 StringStream accumulator(&allocator);
561 accumulator.OutputToFile(out);
563 accumulator.Log(
this);
569 "\n\nAttempt to print stack while printing stack (double fault)\n");
571 "If you are lucky you may find a partial stack dump on stdout.\n\n");
578 StringStream* accumulator,
579 StackFrame::PrintMode
mode) {
581 for (
int i = 0; !it.done(); it.
Advance()) {
590 "\n==== JS stack trace is not available =======================\n\n");
592 "\n==== Isolate for the thread is not initialized =============\n\n");
597 DCHECK(StringStream::IsMentionedObjectCacheClear(
this));
603 "\n==== JS stack trace =========================================\n\n");
604 PrintFrames(
this, accumulator, StackFrame::OVERVIEW);
607 "\n==== Details ================================================\n\n");
608 PrintFrames(
this, accumulator, StackFrame::DETAILS);
610 accumulator->PrintMentionedObjectCache(
this);
611 accumulator->Add(
"=====================\n\n");
623 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor());
624 if (!constructor->shared()->IsApiFunction())
return NULL;
627 constructor->shared()->get_api_func_data()->access_check_info();
628 if (data_obj == isolate->
heap()->undefined_value())
return NULL;
630 return AccessCheckInfo::cast(data_obj);
640 this, error,
factory()->NewTypeError(message), );
645 DCHECK(receiver->IsAccessCheckNeeded());
653 if (!access_check_info)
return;
654 data =
handle(access_check_info->data(),
this);
678 if (receiver->IsJSGlobalProxy()) {
679 Object* receiver_context = JSGlobalProxy::cast(*receiver)->native_context();
680 if (!receiver_context->IsContext())
return NO;
686 if (receiver_context == native_context)
return YES;
689 native_context->security_token())
700 DCHECK(receiver->IsJSGlobalProxy() || receiver->IsAccessCheckNeeded());
704 if (key.is_identical_to(
factory()->hidden_string()))
return true;
711 if (decision !=
UNKNOWN)
return decision ==
YES;
718 if (!access_check_info)
return false;
719 Object* fun_obj = access_check_info->named_callback();
720 callback = v8::ToCData<v8::NamedSecurityCallback>(fun_obj);
721 if (!callback)
return false;
722 data =
handle(access_check_info->data(),
this);
725 LOG(
this, ApiNamedSecurityCheck(*key));
739 DCHECK(receiver->IsJSGlobalProxy() || receiver->IsAccessCheckNeeded());
745 if (decision !=
UNKNOWN)
return decision ==
YES;
753 if (!access_check_info)
return false;
754 Object* fun_obj = access_check_info->indexed_callback();
755 callback = v8::ToCData<v8::IndexedSecurityCallback>(fun_obj);
756 if (!callback)
return false;
757 data =
handle(access_check_info->data(),
this);
760 LOG(
this, ApiIndexedSecurityCheck(index));
770 "Uncaught RangeError: Maximum call stack size exceeded";
785 return heap()->exception();
791 return heap()->exception();
818 callback = api_interrupt_callback_;
819 data = api_interrupt_callback_data_;
820 api_interrupt_callback_ =
NULL;
821 api_interrupt_callback_data_ =
NULL;
824 if (callback !=
NULL) {
827 callback(
reinterpret_cast<v8::Isolate*
>(
this), data);
834 return heap()->exception();
839 bool can_be_caught_externally =
false;
848 return heap()->exception();
853 if (FLAG_stack_trace_on_illegal)
PrintStack(stdout);
878 DCHECK(message->IsJSMessageObject() || message->IsTheHole());
879 DCHECK(script->IsScript() || script->IsTheHole());
910 int pos = frame->LookupCode()->SourcePosition(frame->pc());
923 Execution::GetStackTraceLine(recv, fun, pos_obj, is_top_level);
924 if (line->length() > 0) {
938 Object* script = fun->shared()->script();
939 if (script->IsScript() &&
940 !(Script::cast(script)->source()->IsUndefined())) {
941 int pos = frame->LookupCode()->SourcePosition(frame->pc());
951 bool catchable_by_javascript) {
961 Address external_handler_address =
967 *can_be_caught_externally = external_handler_address !=
NULL &&
969 !catchable_by_javascript);
971 if (*can_be_caught_externally) {
982 if (!obj->IsJSObject())
return false;
991 !iter.
IsAtEnd(); iter.Advance()) {
992 if (iter.GetCurrent()->IsJSProxy())
return false;
993 if (JSObject::cast(iter.GetCurrent())->map()->constructor() ==
994 *error_constructor) {
1011 bool can_be_caught_externally =
false;
1012 bool should_report_exception =
1014 bool report_exception = catchable_by_javascript && should_report_exception;
1015 bool try_catch_needs_message =
1023 if (catchable_by_javascript) {
1028 if (!rethrowing_message && (report_exception || try_catch_needs_message)) {
1030 if (location ==
NULL) {
1033 location = &potential_computed_location;
1038 if (!bootstrapping) {
1047 LookupIterator lookup(exception_handle, key,
1048 LookupIterator::OWN_SKIP_INTERCEPTOR);
1051 stack_trace_property->IsJSArray()) {
1055 if (stack_trace_object.
is_null()) {
1067 if (exception_arg->IsJSObject() && !
IsErrorObject(exception_arg)) {
1069 Execution::ToDetailString(
this, exception_arg);
1070 if (!maybe_exception.ToHandle(&exception_arg)) {
1071 exception_arg =
factory()->InternalizeOneByteString(
1077 "uncaught_exception",
1079 HandleVector<Object>(&exception_arg, 1),
1080 stack_trace_object);
1082 if (location !=
NULL) {
1093 FLAG_abort_on_uncaught_exception &&
1094 (report_exception || can_be_caught_externally)) {
1102 }
else if (location !=
NULL && !location->
script().is_null()) {
1110 if (exception->IsString() && location->
script()->name()->IsString()) {
1112 "Extension or internal compilation error: %s in %s at line %d.\n",
1113 String::cast(exception)->ToCString().get(),
1114 String::cast(location->
script()->name())->ToCString().get(),
1116 }
else if (location->
script()->name()->IsString()) {
1118 "Extension or internal compilation error in %s at line %d.\n",
1119 String::cast(location->
script()->name())->ToCString().get(),
1127 if (location->
script()->source()->IsString()) {
1129 PrintF(
"Failing script:\n");
1130 int len = src->length();
1131 int line_number = 1;
1132 PrintF(
"%5d: ", line_number);
1133 for (
int i = 0;
i < len;
i++) {
1136 if (character ==
'\n' &&
i < len - 2) {
1137 PrintF(
"%5d: ", ++line_number);
1168 Address external_handler_address =
1185 if (
handler->is_finally())
return true;
1248 bool is_termination_exception =
1252 bool clear_exception = is_bottom_call;
1254 if (is_termination_exception) {
1255 if (is_bottom_call) {
1265 Address external_handler_address =
1267 JavaScriptFrameIterator it(
this);
1268 if (it.done() || (it.frame()->sp() > external_handler_address)) {
1269 clear_exception =
true;
1274 if (clear_exception) {
1299 if (tltop->promise_on_stack_ ==
NULL)
return;
1301 Handle<Object> global_handle = tltop->promise_on_stack_->promise();
1302 delete tltop->promise_on_stack_;
1303 tltop->promise_on_stack_ = prev;
1311 if (tltop->promise_on_stack_ ==
NULL)
return undefined;
1312 StackHandler* promise_try = tltop->promise_on_stack_->handler();
1319 return tltop->promise_on_stack_->promise();
1350 JavaScriptFrameIterator it(
this);
1352 while (!it.done()) {
1371 sizeof(ThreadLocalTop));
1376 return to +
sizeof(ThreadLocalTop);
1382 sizeof(ThreadLocalTop));
1385 #ifdef USE_SIMULATOR
1389 return from +
sizeof(ThreadLocalTop);
1407 #if defined(USE_SIMULATOR)
1417 if (data->Matches(isolate, thread_id))
return data;
1424 if (list_ !=
NULL) list_->prev_ = data;
1425 data->
next_ = list_;
1431 if (list_ == data) list_ = data->
next_;
1440 while (data !=
NULL) {
1442 if (data->
isolate() == isolate) Remove(data);
1449 #define TRACE_ISOLATE(tag) \
1451 if (FLAG_trace_isolates) { \
1452 PrintF("Isolate %p (id %d)" #tag "\n", \
1453 reinterpret_cast<void*>(this), id()); \
1457 #define TRACE_ISOLATE(tag)
1535 memset(&js_spill_information_, 0,
sizeof(js_spill_information_));
1540 #define ISOLATE_INIT_EXECUTE(type, name, initial_value) \
1541 name##_ = (initial_value);
1543 #undef ISOLATE_INIT_EXECUTE
1545 #define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length) \
1546 memset(name##_, 0, sizeof(type) * length);
1548 #undef ISOLATE_INIT_ARRAY_EXECUTE
1563 Isolate* saved_isolate = UncheckedCurrent();
1573 if (serialize_partial_snapshot_cache_ !=
NULL) {
1574 delete[] serialize_partial_snapshot_cache_;
1575 serialize_partial_snapshot_cache_ =
NULL;
1613 if (FLAG_job_based_sweeping &&
1621 if (FLAG_print_deopt_stress) {
1657 int length = serialize_partial_snapshot_cache_length();
1658 int capacity = serialize_partial_snapshot_cache_capacity();
1660 if (length >= capacity) {
1661 int new_capacity =
static_cast<int>((capacity + 10) * 1.2);
1663 for (
int i = 0;
i < length;
i++) {
1664 new_array[
i] = serialize_partial_snapshot_cache()[
i];
1666 if (capacity != 0)
delete[] serialize_partial_snapshot_cache();
1667 set_serialize_partial_snapshot_cache(new_array);
1668 set_serialize_partial_snapshot_cache_capacity(new_capacity);
1671 serialize_partial_snapshot_cache()[length] = obj;
1672 set_serialize_partial_snapshot_cache_length(length + 1);
1757 delete string_stream_debug_object_cache_;
1758 string_stream_debug_object_cache_ =
NULL;
1760 delete external_reference_table_;
1761 external_reference_table_ =
NULL;
1781 if (!has_external_try_catch) {
1803 handler->can_continue_ =
true;
1804 handler->has_terminated_ =
false;
1853 #define ASSIGN_ELEMENT(CamelName, hacker_name) \
1854 isolate_addresses_[Isolate::k##CamelName##Address] = \
1855 reinterpret_cast<Address>(hacker_name##_address());
1857 #undef ASSIGN_ELEMENT
1886 #if defined(USE_SIMULATOR)
1887 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || \
1888 V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
1889 Simulator::Initialize(
this);
1912 const bool create_heap_objects = (des ==
NULL);
1918 if (create_heap_objects) {
1928 if (FLAG_log_internal_timer_events) {
1937 if (max_available_threads_ < 1) {
1939 max_available_threads_ =
1940 Max(
Min(base::SysInfo::NumberOfProcessors(), 4), 1);
1943 if (!FLAG_job_based_sweeping) {
1948 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) {
1949 PrintF(
"Concurrent recompilation has been disabled for tracing.\n");
1964 if (!create_heap_objects) {
1985 if (!create_heap_objects &&
1988 FLAG_perf_jit_prof ||
1989 FLAG_perf_basic_prof ||
1992 LOG(
this, LogCodeObjects());
1993 LOG(
this, LogCompiledFunctions());
2011 if (!create_heap_objects) {
2026 CodeStub::GenerateFPStubs(
this);
2050 if (current_data !=
NULL) {
2051 current_isolate = current_data->
isolate_;
2053 if (current_isolate ==
this) {
2054 DCHECK(Current() ==
this);
2120 deferred_iterator = deferred_iterator->
previous_;
2137 if (hstatistics() ==
NULL) set_hstatistics(
new HStatistics());
2138 return hstatistics();
2143 if (tstatistics() ==
NULL) set_tstatistics(
new HStatistics());
2144 return tstatistics();
2149 if (htracer() ==
NULL) set_htracer(
new HTracer(
id()));
2155 if (code_tracer() ==
NULL) set_code_tracer(
new CodeTracer(
id()));
2156 return code_tracer();
2163 if (!maybe_map_array->IsUndefined()) {
2164 Object* maybe_transitioned_map =
2165 FixedArray::cast(maybe_map_array)->get(kind);
2166 if (!maybe_transitioned_map->IsUndefined()) {
2167 return Map::cast(maybe_transitioned_map);
2175 return FLAG_crankshaft &&
2182 Map* root_array_map =
2185 JSObject* initial_array_proto = JSObject::cast(*initial_array_prototype());
2188 if (root_array_map->prototype() != initial_array_proto)
return false;
2189 if (initial_array_proto->elements() !=
heap()->empty_fixed_array()) {
2194 JSObject* initial_object_proto = JSObject::cast(*initial_object_prototype());
2199 if (initial_object_proto->elements() !=
heap()->empty_fixed_array()) {
2220 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \
2221 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_);
2224 #undef ISOLATE_FIELD_OFFSET
2229 if (
heap()->symbol_registry()->IsUndefined()) {
2232 heap()->set_symbol_registry(*registry);
2234 static const char* nested[] = {
2235 "for",
"for_api",
"for_intern",
"keyFor",
"private_api",
"private_intern"
2267 bool run_microtasks = autorun_microtasks() && pending_microtask_count();
2268 if (!has_call_completed_callbacks && !run_microtasks)
return;
2282 DCHECK(microtask->IsJSFunction() || microtask->IsCallHandlerInfo());
2284 int num_tasks = pending_microtask_count();
2285 DCHECK(num_tasks <= queue->length());
2286 if (num_tasks == 0) {
2287 queue =
factory()->NewFixedArray(8);
2288 heap()->set_microtask_queue(*queue);
2289 }
else if (num_tasks == queue->length()) {
2291 heap()->set_microtask_queue(*queue);
2293 DCHECK(queue->get(num_tasks)->IsUndefined());
2294 queue->set(num_tasks, *microtask);
2295 set_pending_microtask_count(num_tasks + 1);
2311 while (pending_microtask_count() > 0) {
2313 int num_tasks = pending_microtask_count();
2315 DCHECK(num_tasks <= queue->length());
2316 set_pending_microtask_count(0);
2317 heap()->set_microtask_queue(
heap()->empty_fixed_array());
2319 for (
int i = 0;
i < num_tasks;
i++) {
2322 if (microtask->IsJSFunction()) {
2325 SaveContext save(
this);
2326 set_context(microtask_function->context()->native_context());
2329 Execution::TryCall(microtask_function,
factory()->undefined_value(),
2330 0,
NULL, &maybe_exception);
2335 heap()->set_microtask_queue(
heap()->empty_fixed_array());
2336 set_pending_microtask_count(0);
2343 v8::ToCData<v8::MicrotaskCallback>(callback_info->callback());
2344 void* data = v8::ToCData<void*>(callback_info->data());
2373 bool StackLimitCheck::JsHasOverflowed()
const {
2374 StackGuard* stack_guard = isolate_->stack_guard();
2375 #ifdef USE_SIMULATOR
2377 Address jssp_address = Simulator::current(isolate_)->get_sp();
2379 if (jssp < stack_guard->real_jslimit())
return true;
2385 bool PostponeInterruptsScope::Intercept(StackGuard::InterruptFlag
flag) {
2387 if (prev_ && prev_->Intercept(
flag))
return true;
2389 if ((
flag & intercept_mask_)) {
2390 intercepted_flags_ |=
flag;
Do not run microtasks while this scope is active, even if microtasks are automatically executed other...
Isolate represents an isolated instance of the V8 engine.
void(* UseCounterCallback)(Isolate *isolate, UseCounterFeature feature)
UseCounterFeature
Features reported via the SetUseCounterCallback callback.
Representation of a JavaScript stack trace.
StackTraceOptions
Flags that determine what information is placed captured for each StackFrame when grabbing the curren...
@ kExposeFramesAcrossSecurityOrigins
An external exception handler.
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)
static void PrintError(const char *format,...)
static double TimeCurrentMillis()
static int GetThreadLocalInt(LocalStorageKey key)
static LocalStorageKey CreateThreadLocalKey()
static void SetThreadLocalInt(LocalStorageKey key, int value)
static void SetThreadLocal(LocalStorageKey key, void *value)
static void QuietNaN(HeapObject *nan)
void SetUp(Isolate *isolate, bool create_heap_objects)
static Context * cast(Object *context)
Context * native_context()
GlobalObject * global_object()
static bool SupportsCrankshaft()
void OnThrow(Handle< Object > exception, bool uncaught)
bool in_debug_scope() const
Handle< Context > debug_context()
DeferredHandles * previous_
static void EnsureCodeForDeoptimizationEntry(Isolate *isolate, BailoutType type, int max_entry_id)
void Deserialize(Isolate *isolate)
static Handle< FixedArray > CopySize(Handle< FixedArray > array, int new_length, PretenureFlag pretenure=NOT_TENURED)
static void Destroy(Object **location)
static Handle< T > cast(Handle< S > that)
static Handle< T > null()
int64_t amount_of_external_allocated_memory_
Object * roots_[kRootListLength]
int64_t amount_of_external_allocated_memory_at_last_global_gc_
MarkCompactCollector * mark_compact_collector()
Code * GcSafeFindCodeForInnerPointer(Address inner_pointer)
static const int kIsolateRootsOffset
static const int kAmountOfExternalAllocatedMemoryAtLastGlobalGCOffset
static const int kAmountOfExternalAllocatedMemoryOffset
static const int kIsolateEmbedderDataOffset
PerIsolateThreadData * previous_thread_data
Isolate * previous_isolate
EntryStackItem * previous_item
ThreadId thread_id() const
PerIsolateThreadData * next_
Isolate * isolate() const
PerIsolateThreadData * prev_
PerIsolateThreadData * Lookup(Isolate *isolate, ThreadId thread_id)
void Remove(PerIsolateThreadData *data)
void Insert(PerIsolateThreadData *data)
void RemoveAllThreads(Isolate *isolate)
void RestorePendingMessageFromTryCatch(v8::TryCatch *handler)
PerIsolateThreadData * FindPerThreadDataForThread(ThreadId thread_id)
double time_millis_at_init_
UnicodeCache * unicode_cache_
int stack_trace_for_uncaught_exceptions_frame_limit_
static void InitializeOncePerProcess()
int next_optimization_id_
bool initialized_from_snapshot_
void UnlinkDeferredHandles(DeferredHandles *deferred_handles)
ContextSlotCache * context_slot_cache_
Handle< GlobalObject > global_object()
CpuProfiler * cpu_profiler_
BasicBlockProfiler * GetOrCreateBasicBlockProfiler()
bool serializer_enabled() const
void ReportFailedAccessCheck(Handle< JSObject > receiver, v8::AccessType type)
base::RandomNumberGenerator * random_number_generator_
bool ShouldReportException(bool *can_be_caught_externally, bool catchable_by_javascript)
void clear_scheduled_exception()
EntryStackItem * entry_stack_
Object * ThrowIllegalOperation()
bool has_installed_extensions_
Handle< Object > CaptureSimpleStackTrace(Handle< JSObject > error_object, Handle< Object > caller)
RegExpStack * regexp_stack_
static Address c_entry_fp(ThreadLocalTop *thread)
bool has_scheduled_exception()
Object * scheduled_exception()
friend class ThreadManager
DeferredHandles * deferred_handles_head_
void PrintCurrentStackTrace(FILE *out)
Object * TerminateExecution()
void CountUsage(v8::Isolate::UseCounterFeature feature)
static const char *const kStackOverflowMessage
HandleScopeImplementer * handle_scope_implementer()
bool is_catchable_by_javascript(Object *exception)
HandleScopeImplementer * handle_scope_implementer_
void EnqueueMicrotask(Handle< Object > microtask)
HeapProfiler * heap_profiler_
void SetFailedAccessCheckCallback(v8::FailedAccessCheckCallback callback)
bool PropagatePendingExceptionToExternalTryCatch()
void clear_pending_message()
HandleScopeData handle_scope_data_
CallInterfaceDescriptorData * call_descriptor_data(int index)
FunctionEntryHook function_entry_hook_
Handle< Context > GetCallingNativeContext()
OptimizingCompilerThread * optimizing_compiler_thread_
Object * FindCodeObject(Address a)
bool MayIndexedAccess(Handle< JSObject > receiver, uint32_t index, v8::AccessType type)
friend class HandleScopeImplementer
void CaptureAndSetSimpleStackTrace(Handle< JSObject > error_object, Handle< Object > caller)
static base::Thread::LocalStorageKey per_isolate_thread_data_key_
FunctionEntryHook function_entry_hook()
void UnregisterTryCatchHandler(v8::TryCatch *that)
Handle< Context > native_context()
Object * pending_exception()
void RemoveCallCompletedCallback(CallCompletedCallback callback)
void InitializeThreadLocal()
static void GlobalTearDown()
void PrintStack(StringStream *accumulator)
static ThreadDataTable * thread_data_table_
CompilationCache * compilation_cache_
void CancelTerminateExecution()
InnerPointerToCodeCache * inner_pointer_to_code_cache_
Object * ReThrow(Object *exception)
BasicBlockProfiler * basic_block_profiler_
PerIsolateThreadData * FindPerThreadDataForThisThread()
void CancelScheduledExceptionFromTryCatch(v8::TryCatch *handler)
void * embedder_data_[Internals::kNumIsolateDataSlots]
static base::Thread::LocalStorageKey thread_id_key_
ConsStringIteratorOp * write_iterator_
void ScheduleThrow(Object *exception)
int stack_trace_nesting_level_
Handle< String > StackTraceString()
SweeperThread ** sweeper_thread_
void PushToPartialSnapshotCache(Object *obj)
void SetUseCounterCallback(v8::Isolate::UseCounterCallback callback)
static base::Atomic32 isolate_counter_
void SetCaptureStackTraceForUncaughtExceptions(bool capture, int frame_limit, StackTrace::StackTraceOptions options)
HStatistics * GetTStatistics()
ThreadManager * thread_manager_
void IterateThread(ThreadVisitor *v, char *t)
void set_context(Context *context)
CodeAgingHelper * code_aging_helper_
static PerIsolateThreadData * CurrentPerIsolateThreadData()
Address isolate_addresses_[kIsolateAddressCount+1]
char * RestoreThread(char *from)
void FreeThreadResources()
void Iterate(ObjectVisitor *v)
void InitializeLoggingAndCounters()
char * ArchiveThread(char *to)
Object * Throw(Object *exception, MessageLocation *location=NULL)
Handle< JSBuiltinsObject > js_builtins_object()
static base::Thread::LocalStorageKey isolate_key_
GlobalHandles * global_handles_
StringTracker * string_tracker_
Handle< Context > global_context()
v8::TryCatch * try_catch_handler()
PerIsolateThreadData * FindOrAllocatePerThreadDataForThisThread()
void FireCallCompletedCallback()
InnerPointerToCodeCache * inner_pointer_to_code_cache()
static void SetIsolateThreadLocals(Isolate *isolate, PerIsolateThreadData *data)
void IterateDeferredHandles(ObjectVisitor *visitor)
void ReportPendingMessages()
Address get_address_from_id(AddressId id)
MessageLocation GetMessageLocation()
ThreadLocalTop * thread_local_top()
void CaptureAndSetDetailedStackTrace(Handle< JSObject > error_object)
bool HasExternalTryCatch()
HStatistics * GetHStatistics()
CodeTracer * GetCodeTracer()
StackTrace::StackTraceOptions stack_trace_for_uncaught_exceptions_options_
void AddCallCompletedCallback(CallCompletedCallback callback)
StringStream * incomplete_message_
void PushPromise(Handle< JSObject > promise)
Handle< JSObject > GetSymbolRegistry()
bool use_crankshaft() const
Handle< JSArray > CaptureCurrentStackTrace(int frame_limit, StackTrace::StackTraceOptions options)
DescriptorLookupCache * descriptor_lookup_cache_
Address try_catch_handler_address()
Handle< Object > GetPromiseOnStackOnThrow()
static Address handler(ThreadLocalTop *thread)
void set_pending_exception(Object *exception_obj)
unsigned int stress_deopt_count_
friend class OptimizingCompilerThread
KeyedLookupCache * keyed_lookup_cache_
DeoptimizerData * deoptimizer_data_
MemoryAllocator * memory_allocator_
Object * PromoteScheduledException()
bool Init(Deserializer *des)
bool concurrent_recompilation_enabled()
List< CallCompletedCallback > call_completed_callbacks_
void clear_pending_exception()
ThreadLocalTop thread_local_top_
void LinkDeferredHandles(DeferredHandles *deferred_handles)
MaterializedObjectStore * materialized_object_store_
StatsTable * stats_table_
bool MayNamedAccess(Handle< JSObject > receiver, Handle< Object > key, v8::AccessType type)
void DoThrow(Object *exception, MessageLocation *location)
void ComputeLocation(MessageLocation *target)
RuntimeProfiler * runtime_profiler_
friend class ExecutionAccess
CallInterfaceDescriptorData * call_descriptor_data_
bool IsErrorObject(Handle< Object > obj)
bool IsFastArrayConstructorPrototypeChainIntact()
bool capture_stack_trace_for_uncaught_exceptions_
StatsTable * stats_table()
friend class SweeperThread
bool OptionalRescheduleException(bool is_bottom_call)
void RegisterTryCatchHandler(v8::TryCatch *that)
void InvokeApiInterruptCallback()
Bootstrapper * bootstrapper_
static base::LazyMutex thread_data_table_mutex_
GlobalHandles * global_handles()
v8::Isolate::UseCounterCallback use_counter_callback_
Map * get_initial_js_array_map(ElementsKind kind)
EternalHandles * eternal_handles_
Bootstrapper * bootstrapper()
bool has_pending_exception()
bool IsFromExtensionScript()
bool IsFromNativeScript()
static void NormalizeProperties(Handle< JSObject > object, PropertyNormalizationMode mode, int expected_additional_properties)
static const int kHeaderSize
static Handle< Object > GetDataProperty(Handle< JSObject > object, Handle< Name > key)
static int NewElementsCapacity(int old_capacity)
static void AddProperty(Handle< JSObject > object, Handle< Name > key, Handle< Object > value, PropertyAttributes attributes)
Object * receiver() const
virtual void Summarize(List< FrameSummary > *frames)
JSFunction * function() const
void Add(const T &element, AllocationPolicy allocator=AllocationPolicy())
static void EmptyTimerEventsLogger(const char *name, int se)
bool is_logging_code_events()
bool SetUp(Isolate *isolate)
static void DefaultTimerEventsLogger(const char *name, int se)
bool sweeping_in_progress()
void EnsureSweepingCompleted()
static void ReportMessage(Isolate *isolate, MessageLocation *loc, Handle< Object > message)
static SmartArrayPointer< char > GetLocalizedMessage(Isolate *isolate, Handle< Object > data)
static Handle< JSMessageObject > MakeMessageObject(Isolate *isolate, const char *type, MessageLocation *loc, Vector< Handle< Object > > args, Handle< JSArray > stack_frames)
Handle< Script > script() const
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
static MUST_USE_RESULT MaybeHandle< Object > SetProperty(Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
static bool Enabled(int max_available)
A class to uniformly access the prototype of any Object and walk its prototype chain.
bool IsAtEnd(WhereToEnd where_to_end=END_AT_NULL) const
Object * GetCurrent() const
static Handle< Object > GetNameOrSourceURL(Handle< Script > script)
static int GetLineNumber(Handle< Script > script, int code_pos)
static Smi * FromInt(int value)
StackFrame * frame() const
static void GenerateFixedRegStubsAheadOfTime(Isolate *isolate)
static void WriteToFlat(String *source, sinkchar *sink, int from, int to)
static void GenerateAheadOfTime(Isolate *isolate)
static int NumberOfThreads(int max_available)
static ThreadId Invalid()
static int AllocateThreadId()
static ThreadId Current()
static int GetCurrentThreadId()
static base::Atomic32 highest_thread_id_
virtual void VisitThread(Isolate *isolate, ThreadLocalTop *top)=0
static void FatalProcessOutOfMemory(const char *location, bool take_snapshot=false)
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS 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 enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define ISOLATE_INIT_ARRAY_EXECUTE(type, name, length)
#define TRACE_ISOLATE(tag)
#define ASSIGN_ELEMENT(CamelName, hacker_name)
#define ISOLATE_INIT_EXECUTE(type, name, initial_value)
#define ISOLATE_INIT_ARRAY_LIST(V)
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value)
#define ISOLATE_INIT_LIST(V)
#define FOR_EACH_ISOLATE_ADDRESS_NAME(C)
#define LOG(isolate, Call)
#define CHECK_EQ(expected, value)
#define DCHECK(condition)
#define OFFSET_OF(type, field)
#define LAZY_MUTEX_INITIALIZER
LazyStaticInstance< Mutex, DefaultConstructTrait< Mutex >, ThreadSafeInitOnceTrait >::type LazyMutex
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr, Atomic32 increment)
static LifetimePosition Min(LifetimePosition a, LifetimePosition b)
const int kDeoptTableSerializeEntryCount
static void PrintFrames(Isolate *isolate, StringStream *accumulator, StackFrame::PrintMode mode)
Handle< T > handle(T *t, Isolate *isolate)
const int kHandleBlockSize
static bool IsVisibleInStackTrace(JSFunction *fun, Object *caller, Object *receiver, bool *seen_caller)
DISABLE_ASAN uintptr_t GetCurrentStackPosition()
static LifetimePosition Max(LifetimePosition a, LifetimePosition b)
void PrintF(const char *format,...)
static MayAccessDecision MayAccessPreCheck(Isolate *isolate, Handle< JSObject > receiver, v8::AccessType type)
kFeedbackVectorOffset flag
static AccessCheckInfo * GetAccessCheckInfo(Isolate *isolate, Handle< JSObject > receiver)
static int fatal_exception_depth
void MemCopy(void *dest, const void *src, size_t size)
ElementsKind GetInitialFastElementsKind()
int FastD2IChecked(double x)
static intptr_t Free(PagedSpace *space, FreeList *free_list, Address start, int size)
@ KEEP_INOBJECT_PROPERTIES
Debugger support for the V8 JavaScript engine.
void(* FailedAccessCheckCallback)(Local< Object > target, AccessType type, Local< Value > data)
void(* MicrotaskCallback)(void *data)
void(* CallCompletedCallback)()
bool(* NamedSecurityCallback)(Local< Object > host, Local< Value > key, AccessType type, Local< Value > data)
Returns true if cross-context access should be allowed to the named property with the given key on th...
AccessType
Access type specification.
bool(* IndexedSecurityCallback)(Local< Object > host, uint32_t index, AccessType type, Local< Value > data)
Returns true if cross-context access should be allowed to the indexed property with the given index o...
void(* InterruptCallback)(Isolate *isolate, void *data)
#define STATIC_CHAR_VECTOR(x)