OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 stack_trace_nesting_level_++; | 801 stack_trace_nesting_level_++; |
802 OS::PrintError( | 802 OS::PrintError( |
803 "\n\nAttempt to print stack while printing stack (double fault)\n"); | 803 "\n\nAttempt to print stack while printing stack (double fault)\n"); |
804 OS::PrintError( | 804 OS::PrintError( |
805 "If you are lucky you may find a partial stack dump on stdout.\n\n"); | 805 "If you are lucky you may find a partial stack dump on stdout.\n\n"); |
806 incomplete_message_->OutputToStdOut(); | 806 incomplete_message_->OutputToStdOut(); |
807 } | 807 } |
808 } | 808 } |
809 | 809 |
810 | 810 |
811 static void PrintFrames(StringStream* accumulator, | 811 static void PrintFrames(Isolate* isolate, |
| 812 StringStream* accumulator, |
812 StackFrame::PrintMode mode) { | 813 StackFrame::PrintMode mode) { |
813 StackFrameIterator it; | 814 StackFrameIterator it(isolate); |
814 for (int i = 0; !it.done(); it.Advance()) { | 815 for (int i = 0; !it.done(); it.Advance()) { |
815 it.frame()->Print(accumulator, mode, i++); | 816 it.frame()->Print(accumulator, mode, i++); |
816 } | 817 } |
817 } | 818 } |
818 | 819 |
819 | 820 |
820 void Isolate::PrintStack(StringStream* accumulator) { | 821 void Isolate::PrintStack(StringStream* accumulator) { |
821 if (!IsInitialized()) { | 822 if (!IsInitialized()) { |
822 accumulator->Add( | 823 accumulator->Add( |
823 "\n==== JS stack trace is not available =======================\n\n"); | 824 "\n==== JS stack trace is not available =======================\n\n"); |
824 accumulator->Add( | 825 accumulator->Add( |
825 "\n==== Isolate for the thread is not initialized =============\n\n"); | 826 "\n==== Isolate for the thread is not initialized =============\n\n"); |
826 return; | 827 return; |
827 } | 828 } |
828 // The MentionedObjectCache is not GC-proof at the moment. | 829 // The MentionedObjectCache is not GC-proof at the moment. |
829 AssertNoAllocation nogc; | 830 AssertNoAllocation nogc; |
830 ASSERT(StringStream::IsMentionedObjectCacheClear()); | 831 ASSERT(StringStream::IsMentionedObjectCacheClear()); |
831 | 832 |
832 // Avoid printing anything if there are no frames. | 833 // Avoid printing anything if there are no frames. |
833 if (c_entry_fp(thread_local_top()) == 0) return; | 834 if (c_entry_fp(thread_local_top()) == 0) return; |
834 | 835 |
835 accumulator->Add( | 836 accumulator->Add( |
836 "\n==== JS stack trace =========================================\n\n"); | 837 "\n==== JS stack trace =========================================\n\n"); |
837 PrintFrames(accumulator, StackFrame::OVERVIEW); | 838 PrintFrames(this, accumulator, StackFrame::OVERVIEW); |
838 | 839 |
839 accumulator->Add( | 840 accumulator->Add( |
840 "\n==== Details ================================================\n\n"); | 841 "\n==== Details ================================================\n\n"); |
841 PrintFrames(accumulator, StackFrame::DETAILS); | 842 PrintFrames(this, accumulator, StackFrame::DETAILS); |
842 | 843 |
843 accumulator->PrintMentionedObjectCache(); | 844 accumulator->PrintMentionedObjectCache(); |
844 accumulator->Add("=====================\n\n"); | 845 accumulator->Add("=====================\n\n"); |
845 } | 846 } |
846 | 847 |
847 | 848 |
848 void Isolate::SetFailedAccessCheckCallback( | 849 void Isolate::SetFailedAccessCheckCallback( |
849 v8::FailedAccessCheckCallback callback) { | 850 v8::FailedAccessCheckCallback callback) { |
850 thread_local_top()->failed_access_check_callback_ = callback; | 851 thread_local_top()->failed_access_check_callback_ = callback; |
851 } | 852 } |
852 | 853 |
853 | 854 |
854 void Isolate::ReportFailedAccessCheck(JSObject* receiver, v8::AccessType type) { | 855 void Isolate::ReportFailedAccessCheck(JSObject* receiver, v8::AccessType type) { |
855 if (!thread_local_top()->failed_access_check_callback_) return; | 856 if (!thread_local_top()->failed_access_check_callback_) return; |
856 | 857 |
857 ASSERT(receiver->IsAccessCheckNeeded()); | 858 ASSERT(receiver->IsAccessCheckNeeded()); |
858 ASSERT(context()); | 859 ASSERT(context()); |
859 | 860 |
860 // Get the data object from access check info. | 861 // Get the data object from access check info. |
861 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); | 862 JSFunction* constructor = JSFunction::cast(receiver->map()->constructor()); |
862 if (!constructor->shared()->IsApiFunction()) return; | 863 if (!constructor->shared()->IsApiFunction()) return; |
863 Object* data_obj = | 864 Object* data_obj = |
864 constructor->shared()->get_api_func_data()->access_check_info(); | 865 constructor->shared()->get_api_func_data()->access_check_info(); |
865 if (data_obj == heap_.undefined_value()) return; | 866 if (data_obj == heap_.undefined_value()) return; |
866 | 867 |
867 HandleScope scope; | 868 HandleScope scope(this); |
868 Handle<JSObject> receiver_handle(receiver); | 869 Handle<JSObject> receiver_handle(receiver); |
869 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data()); | 870 Handle<Object> data(AccessCheckInfo::cast(data_obj)->data()); |
870 { VMState state(this, EXTERNAL); | 871 { VMState state(this, EXTERNAL); |
871 thread_local_top()->failed_access_check_callback_( | 872 thread_local_top()->failed_access_check_callback_( |
872 v8::Utils::ToLocal(receiver_handle), | 873 v8::Utils::ToLocal(receiver_handle), |
873 type, | 874 type, |
874 v8::Utils::ToLocal(data)); | 875 v8::Utils::ToLocal(data)); |
875 } | 876 } |
876 } | 877 } |
877 | 878 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 } | 1001 } |
1001 return result; | 1002 return result; |
1002 } | 1003 } |
1003 | 1004 |
1004 | 1005 |
1005 const char* const Isolate::kStackOverflowMessage = | 1006 const char* const Isolate::kStackOverflowMessage = |
1006 "Uncaught RangeError: Maximum call stack size exceeded"; | 1007 "Uncaught RangeError: Maximum call stack size exceeded"; |
1007 | 1008 |
1008 | 1009 |
1009 Failure* Isolate::StackOverflow() { | 1010 Failure* Isolate::StackOverflow() { |
1010 HandleScope scope; | 1011 HandleScope scope(this); |
1011 // At this point we cannot create an Error object using its javascript | 1012 // At this point we cannot create an Error object using its javascript |
1012 // constructor. Instead, we copy the pre-constructed boilerplate and | 1013 // constructor. Instead, we copy the pre-constructed boilerplate and |
1013 // attach the stack trace as a hidden property. | 1014 // attach the stack trace as a hidden property. |
1014 Handle<String> key = factory()->stack_overflow_symbol(); | 1015 Handle<String> key = factory()->stack_overflow_symbol(); |
1015 Handle<JSObject> boilerplate = | 1016 Handle<JSObject> boilerplate = |
1016 Handle<JSObject>::cast(GetProperty(js_builtins_object(), key)); | 1017 Handle<JSObject>::cast(GetProperty(js_builtins_object(), key)); |
1017 Handle<JSObject> exception = Copy(boilerplate); | 1018 Handle<JSObject> exception = Copy(boilerplate); |
1018 DoThrow(*exception, NULL); | 1019 DoThrow(*exception, NULL); |
1019 | 1020 |
1020 // Get stack trace limit. | 1021 // Get stack trace limit. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 MaybeObject* thrown = scheduled_exception(); | 1084 MaybeObject* thrown = scheduled_exception(); |
1084 clear_scheduled_exception(); | 1085 clear_scheduled_exception(); |
1085 // Re-throw the exception to avoid getting repeated error reporting. | 1086 // Re-throw the exception to avoid getting repeated error reporting. |
1086 return ReThrow(thrown); | 1087 return ReThrow(thrown); |
1087 } | 1088 } |
1088 | 1089 |
1089 | 1090 |
1090 void Isolate::PrintCurrentStackTrace(FILE* out) { | 1091 void Isolate::PrintCurrentStackTrace(FILE* out) { |
1091 StackTraceFrameIterator it(this); | 1092 StackTraceFrameIterator it(this); |
1092 while (!it.done()) { | 1093 while (!it.done()) { |
1093 HandleScope scope; | 1094 HandleScope scope(this); |
1094 // Find code position if recorded in relocation info. | 1095 // Find code position if recorded in relocation info. |
1095 JavaScriptFrame* frame = it.frame(); | 1096 JavaScriptFrame* frame = it.frame(); |
1096 int pos = frame->LookupCode()->SourcePosition(frame->pc()); | 1097 int pos = frame->LookupCode()->SourcePosition(frame->pc()); |
1097 Handle<Object> pos_obj(Smi::FromInt(pos)); | 1098 Handle<Object> pos_obj(Smi::FromInt(pos)); |
1098 // Fetch function and receiver. | 1099 // Fetch function and receiver. |
1099 Handle<JSFunction> fun(JSFunction::cast(frame->function())); | 1100 Handle<JSFunction> fun(JSFunction::cast(frame->function())); |
1100 Handle<Object> recv(frame->receiver()); | 1101 Handle<Object> recv(frame->receiver()); |
1101 // Advance to the next JavaScript frame and determine if the | 1102 // Advance to the next JavaScript frame and determine if the |
1102 // current frame is the top-level frame. | 1103 // current frame is the top-level frame. |
1103 it.Advance(); | 1104 it.Advance(); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 return true; | 1180 return true; |
1180 } | 1181 } |
1181 } | 1182 } |
1182 return false; | 1183 return false; |
1183 } | 1184 } |
1184 | 1185 |
1185 | 1186 |
1186 void Isolate::DoThrow(Object* exception, MessageLocation* location) { | 1187 void Isolate::DoThrow(Object* exception, MessageLocation* location) { |
1187 ASSERT(!has_pending_exception()); | 1188 ASSERT(!has_pending_exception()); |
1188 | 1189 |
1189 HandleScope scope; | 1190 HandleScope scope(this); |
1190 Handle<Object> exception_handle(exception); | 1191 Handle<Object> exception_handle(exception); |
1191 | 1192 |
1192 // Determine reporting and whether the exception is caught externally. | 1193 // Determine reporting and whether the exception is caught externally. |
1193 bool catchable_by_javascript = is_catchable_by_javascript(exception); | 1194 bool catchable_by_javascript = is_catchable_by_javascript(exception); |
1194 bool can_be_caught_externally = false; | 1195 bool can_be_caught_externally = false; |
1195 bool should_report_exception = | 1196 bool should_report_exception = |
1196 ShouldReportException(&can_be_caught_externally, catchable_by_javascript); | 1197 ShouldReportException(&can_be_caught_externally, catchable_by_javascript); |
1197 bool report_exception = catchable_by_javascript && should_report_exception; | 1198 bool report_exception = catchable_by_javascript && should_report_exception; |
1198 bool try_catch_needs_message = | 1199 bool try_catch_needs_message = |
1199 can_be_caught_externally && try_catch_handler()->capture_message_; | 1200 can_be_caught_externally && try_catch_handler()->capture_message_; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 | 1344 |
1344 | 1345 |
1345 void Isolate::ReportPendingMessages() { | 1346 void Isolate::ReportPendingMessages() { |
1346 ASSERT(has_pending_exception()); | 1347 ASSERT(has_pending_exception()); |
1347 PropagatePendingExceptionToExternalTryCatch(); | 1348 PropagatePendingExceptionToExternalTryCatch(); |
1348 | 1349 |
1349 // If the pending exception is OutOfMemoryException set out_of_memory in | 1350 // If the pending exception is OutOfMemoryException set out_of_memory in |
1350 // the native context. Note: We have to mark the native context here | 1351 // the native context. Note: We have to mark the native context here |
1351 // since the GenerateThrowOutOfMemory stub cannot make a RuntimeCall to | 1352 // since the GenerateThrowOutOfMemory stub cannot make a RuntimeCall to |
1352 // set it. | 1353 // set it. |
1353 HandleScope scope; | 1354 HandleScope scope(this); |
1354 if (thread_local_top_.pending_exception_->IsOutOfMemory()) { | 1355 if (thread_local_top_.pending_exception_->IsOutOfMemory()) { |
1355 context()->mark_out_of_memory(); | 1356 context()->mark_out_of_memory(); |
1356 } else if (thread_local_top_.pending_exception_ == | 1357 } else if (thread_local_top_.pending_exception_ == |
1357 heap()->termination_exception()) { | 1358 heap()->termination_exception()) { |
1358 // Do nothing: if needed, the exception has been already propagated to | 1359 // Do nothing: if needed, the exception has been already propagated to |
1359 // v8::TryCatch. | 1360 // v8::TryCatch. |
1360 } else { | 1361 } else { |
1361 if (thread_local_top_.has_pending_message_) { | 1362 if (thread_local_top_.has_pending_message_) { |
1362 thread_local_top_.has_pending_message_ = false; | 1363 thread_local_top_.has_pending_message_ = false; |
1363 if (!thread_local_top_.pending_message_obj_->IsTheHole()) { | 1364 if (!thread_local_top_.pending_message_obj_->IsTheHole()) { |
1364 HandleScope scope; | 1365 HandleScope scope(this); |
1365 Handle<Object> message_obj(thread_local_top_.pending_message_obj_); | 1366 Handle<Object> message_obj(thread_local_top_.pending_message_obj_); |
1366 if (thread_local_top_.pending_message_script_ != NULL) { | 1367 if (thread_local_top_.pending_message_script_ != NULL) { |
1367 Handle<Script> script(thread_local_top_.pending_message_script_); | 1368 Handle<Script> script(thread_local_top_.pending_message_script_); |
1368 int start_pos = thread_local_top_.pending_message_start_pos_; | 1369 int start_pos = thread_local_top_.pending_message_start_pos_; |
1369 int end_pos = thread_local_top_.pending_message_end_pos_; | 1370 int end_pos = thread_local_top_.pending_message_end_pos_; |
1370 MessageLocation location(script, start_pos, end_pos); | 1371 MessageLocation location(script, start_pos, end_pos); |
1371 MessageHandler::ReportMessage(this, &location, message_obj); | 1372 MessageHandler::ReportMessage(this, &location, message_obj); |
1372 } else { | 1373 } else { |
1373 MessageHandler::ReportMessage(this, NULL, message_obj); | 1374 MessageHandler::ReportMessage(this, NULL, message_obj); |
1374 } | 1375 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 clear_pending_exception(); | 1421 clear_pending_exception(); |
1421 return false; | 1422 return false; |
1422 } | 1423 } |
1423 } else if (thread_local_top()->external_caught_exception_) { | 1424 } else if (thread_local_top()->external_caught_exception_) { |
1424 // If the exception is externally caught, clear it if there are no | 1425 // If the exception is externally caught, clear it if there are no |
1425 // JavaScript frames on the way to the C++ frame that has the | 1426 // JavaScript frames on the way to the C++ frame that has the |
1426 // external handler. | 1427 // external handler. |
1427 ASSERT(thread_local_top()->try_catch_handler_address() != NULL); | 1428 ASSERT(thread_local_top()->try_catch_handler_address() != NULL); |
1428 Address external_handler_address = | 1429 Address external_handler_address = |
1429 thread_local_top()->try_catch_handler_address(); | 1430 thread_local_top()->try_catch_handler_address(); |
1430 JavaScriptFrameIterator it; | 1431 JavaScriptFrameIterator it(this); |
1431 if (it.done() || (it.frame()->sp() > external_handler_address)) { | 1432 if (it.done() || (it.frame()->sp() > external_handler_address)) { |
1432 clear_exception = true; | 1433 clear_exception = true; |
1433 } | 1434 } |
1434 } | 1435 } |
1435 | 1436 |
1436 // Clear the exception if needed. | 1437 // Clear the exception if needed. |
1437 if (clear_exception) { | 1438 if (clear_exception) { |
1438 thread_local_top()->external_caught_exception_ = false; | 1439 thread_local_top()->external_caught_exception_ = false; |
1439 clear_pending_exception(); | 1440 clear_pending_exception(); |
1440 return false; | 1441 return false; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1481 } | 1482 } |
1482 | 1483 |
1483 | 1484 |
1484 Handle<Context> Isolate::global_context() { | 1485 Handle<Context> Isolate::global_context() { |
1485 GlobalObject* global = thread_local_top()->context_->global_object(); | 1486 GlobalObject* global = thread_local_top()->context_->global_object(); |
1486 return Handle<Context>(global->global_context()); | 1487 return Handle<Context>(global->global_context()); |
1487 } | 1488 } |
1488 | 1489 |
1489 | 1490 |
1490 Handle<Context> Isolate::GetCallingNativeContext() { | 1491 Handle<Context> Isolate::GetCallingNativeContext() { |
1491 JavaScriptFrameIterator it; | 1492 JavaScriptFrameIterator it(this); |
1492 #ifdef ENABLE_DEBUGGER_SUPPORT | 1493 #ifdef ENABLE_DEBUGGER_SUPPORT |
1493 if (debug_->InDebugger()) { | 1494 if (debug_->InDebugger()) { |
1494 while (!it.done()) { | 1495 while (!it.done()) { |
1495 JavaScriptFrame* frame = it.frame(); | 1496 JavaScriptFrame* frame = it.frame(); |
1496 Context* context = Context::cast(frame->context()); | 1497 Context* context = Context::cast(frame->context()); |
1497 if (context->native_context() == *debug_->debug_context()) { | 1498 if (context->native_context() == *debug_->debug_context()) { |
1498 it.Advance(); | 1499 it.Advance(); |
1499 } else { | 1500 } else { |
1500 break; | 1501 break; |
1501 } | 1502 } |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 try_catch_handler()->exception_ = pending_exception(); | 1945 try_catch_handler()->exception_ = pending_exception(); |
1945 if (!thread_local_top_.pending_message_obj_->IsTheHole()) { | 1946 if (!thread_local_top_.pending_message_obj_->IsTheHole()) { |
1946 try_catch_handler()->message_ = thread_local_top_.pending_message_obj_; | 1947 try_catch_handler()->message_ = thread_local_top_.pending_message_obj_; |
1947 } | 1948 } |
1948 } | 1949 } |
1949 } | 1950 } |
1950 | 1951 |
1951 | 1952 |
1952 void Isolate::InitializeLoggingAndCounters() { | 1953 void Isolate::InitializeLoggingAndCounters() { |
1953 if (logger_ == NULL) { | 1954 if (logger_ == NULL) { |
1954 logger_ = new Logger; | 1955 logger_ = new Logger(this); |
1955 } | 1956 } |
1956 if (counters_ == NULL) { | 1957 if (counters_ == NULL) { |
1957 counters_ = new Counters; | 1958 counters_ = new Counters; |
1958 } | 1959 } |
1959 } | 1960 } |
1960 | 1961 |
1961 | 1962 |
1962 void Isolate::InitializeDebugger() { | 1963 void Isolate::InitializeDebugger() { |
1963 #ifdef ENABLE_DEBUGGER_SUPPORT | 1964 #ifdef ENABLE_DEBUGGER_SUPPORT |
1964 ScopedLock lock(debugger_access_); | 1965 ScopedLock lock(debugger_access_); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2000 string_tracker_->isolate_ = this; | 2001 string_tracker_->isolate_ = this; |
2001 compilation_cache_ = new CompilationCache(this); | 2002 compilation_cache_ = new CompilationCache(this); |
2002 transcendental_cache_ = new TranscendentalCache(); | 2003 transcendental_cache_ = new TranscendentalCache(); |
2003 keyed_lookup_cache_ = new KeyedLookupCache(); | 2004 keyed_lookup_cache_ = new KeyedLookupCache(); |
2004 context_slot_cache_ = new ContextSlotCache(); | 2005 context_slot_cache_ = new ContextSlotCache(); |
2005 descriptor_lookup_cache_ = new DescriptorLookupCache(); | 2006 descriptor_lookup_cache_ = new DescriptorLookupCache(); |
2006 unicode_cache_ = new UnicodeCache(); | 2007 unicode_cache_ = new UnicodeCache(); |
2007 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this); | 2008 inner_pointer_to_code_cache_ = new InnerPointerToCodeCache(this); |
2008 write_iterator_ = new ConsStringIteratorOp(); | 2009 write_iterator_ = new ConsStringIteratorOp(); |
2009 global_handles_ = new GlobalHandles(this); | 2010 global_handles_ = new GlobalHandles(this); |
2010 bootstrapper_ = new Bootstrapper(); | 2011 bootstrapper_ = new Bootstrapper(this); |
2011 handle_scope_implementer_ = new HandleScopeImplementer(this); | 2012 handle_scope_implementer_ = new HandleScopeImplementer(this); |
2012 stub_cache_ = new StubCache(this, runtime_zone()); | 2013 stub_cache_ = new StubCache(this, runtime_zone()); |
2013 regexp_stack_ = new RegExpStack(); | 2014 regexp_stack_ = new RegExpStack(); |
2014 regexp_stack_->isolate_ = this; | 2015 regexp_stack_->isolate_ = this; |
2015 date_cache_ = new DateCache(); | 2016 date_cache_ = new DateCache(); |
2016 code_stub_interface_descriptors_ = | 2017 code_stub_interface_descriptors_ = |
2017 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; | 2018 new CodeStubInterfaceDescriptor[CodeStub::NUMBER_OF_IDS]; |
2018 memset(code_stub_interface_descriptors_, 0, | 2019 memset(code_stub_interface_descriptors_, 0, |
2019 kPointerSize * CodeStub::NUMBER_OF_IDS); | 2020 kPointerSize * CodeStub::NUMBER_OF_IDS); |
2020 | 2021 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2097 // Quiet the heap NaN if needed on target platform. | 2098 // Quiet the heap NaN if needed on target platform. |
2098 if (!create_heap_objects) Assembler::QuietNaN(heap_.nan_value()); | 2099 if (!create_heap_objects) Assembler::QuietNaN(heap_.nan_value()); |
2099 | 2100 |
2100 runtime_profiler_ = new RuntimeProfiler(this); | 2101 runtime_profiler_ = new RuntimeProfiler(this); |
2101 runtime_profiler_->SetUp(); | 2102 runtime_profiler_->SetUp(); |
2102 | 2103 |
2103 // If we are deserializing, log non-function code objects and compiled | 2104 // If we are deserializing, log non-function code objects and compiled |
2104 // functions found in the snapshot. | 2105 // functions found in the snapshot. |
2105 if (!create_heap_objects && | 2106 if (!create_heap_objects && |
2106 (FLAG_log_code || FLAG_ll_prof || logger_->is_logging_code_events())) { | 2107 (FLAG_log_code || FLAG_ll_prof || logger_->is_logging_code_events())) { |
2107 HandleScope scope; | 2108 HandleScope scope(this); |
2108 LOG(this, LogCodeObjects()); | 2109 LOG(this, LogCodeObjects()); |
2109 LOG(this, LogCompiledFunctions()); | 2110 LOG(this, LogCompiledFunctions()); |
2110 } | 2111 } |
2111 | 2112 |
2112 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)), | 2113 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, state_)), |
2113 Internals::kIsolateStateOffset); | 2114 Internals::kIsolateStateOffset); |
2114 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)), | 2115 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, embedder_data_)), |
2115 Internals::kIsolateEmbedderDataOffset); | 2116 Internals::kIsolateEmbedderDataOffset); |
2116 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), | 2117 CHECK_EQ(static_cast<int>(OFFSET_OF(Isolate, heap_.roots_)), |
2117 Internals::kIsolateRootsOffset); | 2118 Internals::kIsolateRootsOffset); |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2280 | 2281 |
2281 #ifdef DEBUG | 2282 #ifdef DEBUG |
2282 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ | 2283 #define ISOLATE_FIELD_OFFSET(type, name, ignored) \ |
2283 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); | 2284 const intptr_t Isolate::name##_debug_offset_ = OFFSET_OF(Isolate, name##_); |
2284 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) | 2285 ISOLATE_INIT_LIST(ISOLATE_FIELD_OFFSET) |
2285 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) | 2286 ISOLATE_INIT_ARRAY_LIST(ISOLATE_FIELD_OFFSET) |
2286 #undef ISOLATE_FIELD_OFFSET | 2287 #undef ISOLATE_FIELD_OFFSET |
2287 #endif | 2288 #endif |
2288 | 2289 |
2289 } } // namespace v8::internal | 2290 } } // namespace v8::internal |
OLD | NEW |