* code_objects, int* count) : sfis_(sfis), code_objects_(code_objects), count_(count) { } virtual void EnterContext(Context* context) {} virtual void LeaveContext(Context* context) {} virtual void VisitFunction(JSFunction* function) { if (sfis_ != NULL) { sfis_[*count_] = Handle(function->shared()); } if (code_objects_ != NULL) { ASSERT(function->code()->kind() == Code::OPTIMIZED_FUNCTION); code_objects_[*count_] = Handle(function->code()); } *count_ = *count_ + 1; } private: Handle* sfis_; Handle* code_objects_; int* count_; }; static int EnumerateCompiledFunctions(Handle* sfis, Handle* code_objects) { AssertNoAllocation no_alloc; int compiled_funcs_count = 0; // Iterate the heap to find shared function info objects and record // the unoptimized code for them. HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (!obj->IsSharedFunctionInfo()) continue; SharedFunctionInfo* sfi = SharedFunctionInfo::cast(obj); if (sfi->is_compiled() && (!sfi->script()->IsScript() || Script::cast(sfi->script())->HasValidSource())) { if (sfis != NULL) { sfis[compiled_funcs_count] = Handle(sfi); } if (code_objects != NULL) { code_objects[compiled_funcs_count] = Handle(sfi->code()); } ++compiled_funcs_count; } } // Iterate all optimized functions in all contexts. EnumerateOptimizedFunctionsVisitor visitor(sfis, code_objects, &compiled_funcs_count); Deoptimizer::VisitAllOptimizedFunctions(&visitor); return compiled_funcs_count; } void Logger::LogCodeObject(Object* object) { if (FLAG_log_code) { Code* code_object = Code::cast(object); LogEventsAndTags tag = Logger::STUB_TAG; const char* description = "Unknown code from the snapshot"; switch (code_object->kind()) { case Code::FUNCTION: case Code::OPTIMIZED_FUNCTION: return; // We log this later using LogCompiledFunctions. case Code::TYPE_RECORDING_BINARY_OP_IC: // fall through case Code::COMPARE_IC: // fall through case Code::STUB: description = CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); if (description == NULL) description = "A stub from the snapshot"; tag = Logger::STUB_TAG; break; case Code::BUILTIN: description = "A builtin from the snapshot"; tag = Logger::BUILTIN_TAG; break; case Code::KEYED_LOAD_IC: description = "A keyed load IC from the snapshot"; tag = Logger::KEYED_LOAD_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_LOAD_IC: description = "A keyed external array load IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG; break; case Code::LOAD_IC: description = "A load IC from the snapshot"; tag = Logger::LOAD_IC_TAG; break; case Code::STORE_IC: description = "A store IC from the snapshot"; tag = Logger::STORE_IC_TAG; break; case Code::KEYED_STORE_IC: description = "A keyed store IC from the snapshot"; tag = Logger::KEYED_STORE_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_STORE_IC: description = "A keyed external array store IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_STORE_IC_TAG; break; case Code::CALL_IC: description = "A call IC from the snapshot"; tag = Logger::CALL_IC_TAG; break; case Code::KEYED_CALL_IC: description = "A keyed call IC from the snapshot"; tag = Logger::KEYED_CALL_IC_TAG; break; } PROFILE(ISOLATE, CodeCreateEvent(tag, code_object, description)); } } void Logger::LogCodeInfo() { #ifdef ENABLE_LOGGING_AND_PROFILING if (!log_->IsEnabled() || !FLAG_log_code || !FLAG_ll_prof) return; #if V8_TARGET_ARCH_IA32 const char arch[] = "ia32"; #elif V8_TARGET_ARCH_X64 const char arch[] = "x64"; #elif V8_TARGET_ARCH_ARM const char arch[] = "arm"; #else const char arch[] = "unknown"; #endif LogMessageBuilder msg(this); msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize); msg.WriteToLogFile(); #endif // ENABLE_LOGGING_AND_PROFILING } void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { if (!FLAG_ll_prof || log_->output_code_handle_ == NULL) return; int pos = static_cast(ftell(log_->output_code_handle_)); size_t rv = fwrite(code->instruction_start(), 1, code->instruction_size(), log_->output_code_handle_); ASSERT(static_cast(code->instruction_size()) == rv); USE(rv); msg->Append(",%d", pos); } void Logger::LogCodeObjects() { AssertNoAllocation no_alloc; HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (obj->IsCode()) LogCodeObject(obj); } } void Logger::LogCompiledFunctions() { HandleScope scope; const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); ScopedVector< Handle > sfis(compiled_funcs_count); ScopedVector< Handle > code_objects(compiled_funcs_count); EnumerateCompiledFunctions(sfis.start(), code_objects.start()); // During iteration, there can be heap allocation due to // GetScriptLineNumber call. for (int i = 0; i < compiled_funcs_count; ++i) { if (*code_objects[i] == Isolate::Current()->builtins()->builtin( Builtins::kLazyCompile)) continue; Handle shared = sfis[i]; Handle func_name(shared->DebugName()); if (shared->script()->IsScript()) { Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
(function->code()); } *count_ = *count_ + 1; } private: Handle* sfis_; Handle* code_objects_; int* count_; }; static int EnumerateCompiledFunctions(Handle* sfis, Handle* code_objects) { AssertNoAllocation no_alloc; int compiled_funcs_count = 0; // Iterate the heap to find shared function info objects and record // the unoptimized code for them. HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (!obj->IsSharedFunctionInfo()) continue; SharedFunctionInfo* sfi = SharedFunctionInfo::cast(obj); if (sfi->is_compiled() && (!sfi->script()->IsScript() || Script::cast(sfi->script())->HasValidSource())) { if (sfis != NULL) { sfis[compiled_funcs_count] = Handle(sfi); } if (code_objects != NULL) { code_objects[compiled_funcs_count] = Handle(sfi->code()); } ++compiled_funcs_count; } } // Iterate all optimized functions in all contexts. EnumerateOptimizedFunctionsVisitor visitor(sfis, code_objects, &compiled_funcs_count); Deoptimizer::VisitAllOptimizedFunctions(&visitor); return compiled_funcs_count; } void Logger::LogCodeObject(Object* object) { if (FLAG_log_code) { Code* code_object = Code::cast(object); LogEventsAndTags tag = Logger::STUB_TAG; const char* description = "Unknown code from the snapshot"; switch (code_object->kind()) { case Code::FUNCTION: case Code::OPTIMIZED_FUNCTION: return; // We log this later using LogCompiledFunctions. case Code::TYPE_RECORDING_BINARY_OP_IC: // fall through case Code::COMPARE_IC: // fall through case Code::STUB: description = CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); if (description == NULL) description = "A stub from the snapshot"; tag = Logger::STUB_TAG; break; case Code::BUILTIN: description = "A builtin from the snapshot"; tag = Logger::BUILTIN_TAG; break; case Code::KEYED_LOAD_IC: description = "A keyed load IC from the snapshot"; tag = Logger::KEYED_LOAD_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_LOAD_IC: description = "A keyed external array load IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG; break; case Code::LOAD_IC: description = "A load IC from the snapshot"; tag = Logger::LOAD_IC_TAG; break; case Code::STORE_IC: description = "A store IC from the snapshot"; tag = Logger::STORE_IC_TAG; break; case Code::KEYED_STORE_IC: description = "A keyed store IC from the snapshot"; tag = Logger::KEYED_STORE_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_STORE_IC: description = "A keyed external array store IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_STORE_IC_TAG; break; case Code::CALL_IC: description = "A call IC from the snapshot"; tag = Logger::CALL_IC_TAG; break; case Code::KEYED_CALL_IC: description = "A keyed call IC from the snapshot"; tag = Logger::KEYED_CALL_IC_TAG; break; } PROFILE(ISOLATE, CodeCreateEvent(tag, code_object, description)); } } void Logger::LogCodeInfo() { #ifdef ENABLE_LOGGING_AND_PROFILING if (!log_->IsEnabled() || !FLAG_log_code || !FLAG_ll_prof) return; #if V8_TARGET_ARCH_IA32 const char arch[] = "ia32"; #elif V8_TARGET_ARCH_X64 const char arch[] = "x64"; #elif V8_TARGET_ARCH_ARM const char arch[] = "arm"; #else const char arch[] = "unknown"; #endif LogMessageBuilder msg(this); msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize); msg.WriteToLogFile(); #endif // ENABLE_LOGGING_AND_PROFILING } void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { if (!FLAG_ll_prof || log_->output_code_handle_ == NULL) return; int pos = static_cast(ftell(log_->output_code_handle_)); size_t rv = fwrite(code->instruction_start(), 1, code->instruction_size(), log_->output_code_handle_); ASSERT(static_cast(code->instruction_size()) == rv); USE(rv); msg->Append(",%d", pos); } void Logger::LogCodeObjects() { AssertNoAllocation no_alloc; HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (obj->IsCode()) LogCodeObject(obj); } } void Logger::LogCompiledFunctions() { HandleScope scope; const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); ScopedVector< Handle > sfis(compiled_funcs_count); ScopedVector< Handle > code_objects(compiled_funcs_count); EnumerateCompiledFunctions(sfis.start(), code_objects.start()); // During iteration, there can be heap allocation due to // GetScriptLineNumber call. for (int i = 0; i < compiled_funcs_count; ++i) { if (*code_objects[i] == Isolate::Current()->builtins()->builtin( Builtins::kLazyCompile)) continue; Handle shared = sfis[i]; Handle func_name(shared->DebugName()); if (shared->script()->IsScript()) { Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
* code_objects_; int* count_; }; static int EnumerateCompiledFunctions(Handle* sfis, Handle* code_objects) { AssertNoAllocation no_alloc; int compiled_funcs_count = 0; // Iterate the heap to find shared function info objects and record // the unoptimized code for them. HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (!obj->IsSharedFunctionInfo()) continue; SharedFunctionInfo* sfi = SharedFunctionInfo::cast(obj); if (sfi->is_compiled() && (!sfi->script()->IsScript() || Script::cast(sfi->script())->HasValidSource())) { if (sfis != NULL) { sfis[compiled_funcs_count] = Handle(sfi); } if (code_objects != NULL) { code_objects[compiled_funcs_count] = Handle(sfi->code()); } ++compiled_funcs_count; } } // Iterate all optimized functions in all contexts. EnumerateOptimizedFunctionsVisitor visitor(sfis, code_objects, &compiled_funcs_count); Deoptimizer::VisitAllOptimizedFunctions(&visitor); return compiled_funcs_count; } void Logger::LogCodeObject(Object* object) { if (FLAG_log_code) { Code* code_object = Code::cast(object); LogEventsAndTags tag = Logger::STUB_TAG; const char* description = "Unknown code from the snapshot"; switch (code_object->kind()) { case Code::FUNCTION: case Code::OPTIMIZED_FUNCTION: return; // We log this later using LogCompiledFunctions. case Code::TYPE_RECORDING_BINARY_OP_IC: // fall through case Code::COMPARE_IC: // fall through case Code::STUB: description = CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); if (description == NULL) description = "A stub from the snapshot"; tag = Logger::STUB_TAG; break; case Code::BUILTIN: description = "A builtin from the snapshot"; tag = Logger::BUILTIN_TAG; break; case Code::KEYED_LOAD_IC: description = "A keyed load IC from the snapshot"; tag = Logger::KEYED_LOAD_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_LOAD_IC: description = "A keyed external array load IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG; break; case Code::LOAD_IC: description = "A load IC from the snapshot"; tag = Logger::LOAD_IC_TAG; break; case Code::STORE_IC: description = "A store IC from the snapshot"; tag = Logger::STORE_IC_TAG; break; case Code::KEYED_STORE_IC: description = "A keyed store IC from the snapshot"; tag = Logger::KEYED_STORE_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_STORE_IC: description = "A keyed external array store IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_STORE_IC_TAG; break; case Code::CALL_IC: description = "A call IC from the snapshot"; tag = Logger::CALL_IC_TAG; break; case Code::KEYED_CALL_IC: description = "A keyed call IC from the snapshot"; tag = Logger::KEYED_CALL_IC_TAG; break; } PROFILE(ISOLATE, CodeCreateEvent(tag, code_object, description)); } } void Logger::LogCodeInfo() { #ifdef ENABLE_LOGGING_AND_PROFILING if (!log_->IsEnabled() || !FLAG_log_code || !FLAG_ll_prof) return; #if V8_TARGET_ARCH_IA32 const char arch[] = "ia32"; #elif V8_TARGET_ARCH_X64 const char arch[] = "x64"; #elif V8_TARGET_ARCH_ARM const char arch[] = "arm"; #else const char arch[] = "unknown"; #endif LogMessageBuilder msg(this); msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize); msg.WriteToLogFile(); #endif // ENABLE_LOGGING_AND_PROFILING } void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { if (!FLAG_ll_prof || log_->output_code_handle_ == NULL) return; int pos = static_cast(ftell(log_->output_code_handle_)); size_t rv = fwrite(code->instruction_start(), 1, code->instruction_size(), log_->output_code_handle_); ASSERT(static_cast(code->instruction_size()) == rv); USE(rv); msg->Append(",%d", pos); } void Logger::LogCodeObjects() { AssertNoAllocation no_alloc; HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (obj->IsCode()) LogCodeObject(obj); } } void Logger::LogCompiledFunctions() { HandleScope scope; const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); ScopedVector< Handle > sfis(compiled_funcs_count); ScopedVector< Handle > code_objects(compiled_funcs_count); EnumerateCompiledFunctions(sfis.start(), code_objects.start()); // During iteration, there can be heap allocation due to // GetScriptLineNumber call. for (int i = 0; i < compiled_funcs_count; ++i) { if (*code_objects[i] == Isolate::Current()->builtins()->builtin( Builtins::kLazyCompile)) continue; Handle shared = sfis[i]; Handle func_name(shared->DebugName()); if (shared->script()->IsScript()) { Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
* code_objects) { AssertNoAllocation no_alloc; int compiled_funcs_count = 0; // Iterate the heap to find shared function info objects and record // the unoptimized code for them. HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (!obj->IsSharedFunctionInfo()) continue; SharedFunctionInfo* sfi = SharedFunctionInfo::cast(obj); if (sfi->is_compiled() && (!sfi->script()->IsScript() || Script::cast(sfi->script())->HasValidSource())) { if (sfis != NULL) { sfis[compiled_funcs_count] = Handle(sfi); } if (code_objects != NULL) { code_objects[compiled_funcs_count] = Handle(sfi->code()); } ++compiled_funcs_count; } } // Iterate all optimized functions in all contexts. EnumerateOptimizedFunctionsVisitor visitor(sfis, code_objects, &compiled_funcs_count); Deoptimizer::VisitAllOptimizedFunctions(&visitor); return compiled_funcs_count; } void Logger::LogCodeObject(Object* object) { if (FLAG_log_code) { Code* code_object = Code::cast(object); LogEventsAndTags tag = Logger::STUB_TAG; const char* description = "Unknown code from the snapshot"; switch (code_object->kind()) { case Code::FUNCTION: case Code::OPTIMIZED_FUNCTION: return; // We log this later using LogCompiledFunctions. case Code::TYPE_RECORDING_BINARY_OP_IC: // fall through case Code::COMPARE_IC: // fall through case Code::STUB: description = CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); if (description == NULL) description = "A stub from the snapshot"; tag = Logger::STUB_TAG; break; case Code::BUILTIN: description = "A builtin from the snapshot"; tag = Logger::BUILTIN_TAG; break; case Code::KEYED_LOAD_IC: description = "A keyed load IC from the snapshot"; tag = Logger::KEYED_LOAD_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_LOAD_IC: description = "A keyed external array load IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG; break; case Code::LOAD_IC: description = "A load IC from the snapshot"; tag = Logger::LOAD_IC_TAG; break; case Code::STORE_IC: description = "A store IC from the snapshot"; tag = Logger::STORE_IC_TAG; break; case Code::KEYED_STORE_IC: description = "A keyed store IC from the snapshot"; tag = Logger::KEYED_STORE_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_STORE_IC: description = "A keyed external array store IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_STORE_IC_TAG; break; case Code::CALL_IC: description = "A call IC from the snapshot"; tag = Logger::CALL_IC_TAG; break; case Code::KEYED_CALL_IC: description = "A keyed call IC from the snapshot"; tag = Logger::KEYED_CALL_IC_TAG; break; } PROFILE(ISOLATE, CodeCreateEvent(tag, code_object, description)); } } void Logger::LogCodeInfo() { #ifdef ENABLE_LOGGING_AND_PROFILING if (!log_->IsEnabled() || !FLAG_log_code || !FLAG_ll_prof) return; #if V8_TARGET_ARCH_IA32 const char arch[] = "ia32"; #elif V8_TARGET_ARCH_X64 const char arch[] = "x64"; #elif V8_TARGET_ARCH_ARM const char arch[] = "arm"; #else const char arch[] = "unknown"; #endif LogMessageBuilder msg(this); msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize); msg.WriteToLogFile(); #endif // ENABLE_LOGGING_AND_PROFILING } void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { if (!FLAG_ll_prof || log_->output_code_handle_ == NULL) return; int pos = static_cast(ftell(log_->output_code_handle_)); size_t rv = fwrite(code->instruction_start(), 1, code->instruction_size(), log_->output_code_handle_); ASSERT(static_cast(code->instruction_size()) == rv); USE(rv); msg->Append(",%d", pos); } void Logger::LogCodeObjects() { AssertNoAllocation no_alloc; HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (obj->IsCode()) LogCodeObject(obj); } } void Logger::LogCompiledFunctions() { HandleScope scope; const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); ScopedVector< Handle > sfis(compiled_funcs_count); ScopedVector< Handle > code_objects(compiled_funcs_count); EnumerateCompiledFunctions(sfis.start(), code_objects.start()); // During iteration, there can be heap allocation due to // GetScriptLineNumber call. for (int i = 0; i < compiled_funcs_count; ++i) { if (*code_objects[i] == Isolate::Current()->builtins()->builtin( Builtins::kLazyCompile)) continue; Handle shared = sfis[i]; Handle func_name(shared->DebugName()); if (shared->script()->IsScript()) { Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
(sfi->code()); } ++compiled_funcs_count; } } // Iterate all optimized functions in all contexts. EnumerateOptimizedFunctionsVisitor visitor(sfis, code_objects, &compiled_funcs_count); Deoptimizer::VisitAllOptimizedFunctions(&visitor); return compiled_funcs_count; } void Logger::LogCodeObject(Object* object) { if (FLAG_log_code) { Code* code_object = Code::cast(object); LogEventsAndTags tag = Logger::STUB_TAG; const char* description = "Unknown code from the snapshot"; switch (code_object->kind()) { case Code::FUNCTION: case Code::OPTIMIZED_FUNCTION: return; // We log this later using LogCompiledFunctions. case Code::TYPE_RECORDING_BINARY_OP_IC: // fall through case Code::COMPARE_IC: // fall through case Code::STUB: description = CodeStub::MajorName(CodeStub::GetMajorKey(code_object), true); if (description == NULL) description = "A stub from the snapshot"; tag = Logger::STUB_TAG; break; case Code::BUILTIN: description = "A builtin from the snapshot"; tag = Logger::BUILTIN_TAG; break; case Code::KEYED_LOAD_IC: description = "A keyed load IC from the snapshot"; tag = Logger::KEYED_LOAD_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_LOAD_IC: description = "A keyed external array load IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG; break; case Code::LOAD_IC: description = "A load IC from the snapshot"; tag = Logger::LOAD_IC_TAG; break; case Code::STORE_IC: description = "A store IC from the snapshot"; tag = Logger::STORE_IC_TAG; break; case Code::KEYED_STORE_IC: description = "A keyed store IC from the snapshot"; tag = Logger::KEYED_STORE_IC_TAG; break; case Code::KEYED_EXTERNAL_ARRAY_STORE_IC: description = "A keyed external array store IC from the snapshot"; tag = Logger::KEYED_EXTERNAL_ARRAY_STORE_IC_TAG; break; case Code::CALL_IC: description = "A call IC from the snapshot"; tag = Logger::CALL_IC_TAG; break; case Code::KEYED_CALL_IC: description = "A keyed call IC from the snapshot"; tag = Logger::KEYED_CALL_IC_TAG; break; } PROFILE(ISOLATE, CodeCreateEvent(tag, code_object, description)); } } void Logger::LogCodeInfo() { #ifdef ENABLE_LOGGING_AND_PROFILING if (!log_->IsEnabled() || !FLAG_log_code || !FLAG_ll_prof) return; #if V8_TARGET_ARCH_IA32 const char arch[] = "ia32"; #elif V8_TARGET_ARCH_X64 const char arch[] = "x64"; #elif V8_TARGET_ARCH_ARM const char arch[] = "arm"; #else const char arch[] = "unknown"; #endif LogMessageBuilder msg(this); msg.Append("code-info,%s,%d\n", arch, Code::kHeaderSize); msg.WriteToLogFile(); #endif // ENABLE_LOGGING_AND_PROFILING } void Logger::LowLevelCodeCreateEvent(Code* code, LogMessageBuilder* msg) { if (!FLAG_ll_prof || log_->output_code_handle_ == NULL) return; int pos = static_cast(ftell(log_->output_code_handle_)); size_t rv = fwrite(code->instruction_start(), 1, code->instruction_size(), log_->output_code_handle_); ASSERT(static_cast(code->instruction_size()) == rv); USE(rv); msg->Append(",%d", pos); } void Logger::LogCodeObjects() { AssertNoAllocation no_alloc; HeapIterator iterator; for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) { if (obj->IsCode()) LogCodeObject(obj); } } void Logger::LogCompiledFunctions() { HandleScope scope; const int compiled_funcs_count = EnumerateCompiledFunctions(NULL, NULL); ScopedVector< Handle > sfis(compiled_funcs_count); ScopedVector< Handle > code_objects(compiled_funcs_count); EnumerateCompiledFunctions(sfis.start(), code_objects.start()); // During iteration, there can be heap allocation due to // GetScriptLineNumber call. for (int i = 0; i < compiled_funcs_count; ++i) { if (*code_objects[i] == Isolate::Current()->builtins()->builtin( Builtins::kLazyCompile)) continue; Handle shared = sfis[i]; Handle func_name(shared->DebugName()); if (shared->script()->IsScript()) { Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
> code_objects(compiled_funcs_count); EnumerateCompiledFunctions(sfis.start(), code_objects.start()); // During iteration, there can be heap allocation due to // GetScriptLineNumber call. for (int i = 0; i < compiled_funcs_count; ++i) { if (*code_objects[i] == Isolate::Current()->builtins()->builtin( Builtins::kLazyCompile)) continue; Handle shared = sfis[i]; Handle func_name(shared->DebugName()); if (shared->script()->IsScript()) { Handle 登录后可以享受更多权益 您还没有登录,登录后您可以: 收藏Android系统代码 收藏喜欢的文章 多个平台共享账号 去登录 首次使用?从这里 注册
您还没有登录,登录后您可以:
首次使用?从这里 注册