OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/codegen.h" | 5 #include "src/codegen.h" |
6 | 6 |
7 #if defined(V8_OS_AIX) | 7 #if defined(V8_OS_AIX) |
8 #include <fenv.h> // NOLINT(build/c++11) | 8 #include <fenv.h> // NOLINT(build/c++11) |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 | 140 |
141 void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { | 141 void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { |
142 #ifdef ENABLE_DISASSEMBLER | 142 #ifdef ENABLE_DISASSEMBLER |
143 AllowDeferredHandleDereference allow_deference_for_print_code; | 143 AllowDeferredHandleDereference allow_deference_for_print_code; |
144 Isolate* isolate = info->isolate(); | 144 Isolate* isolate = info->isolate(); |
145 bool print_code = | 145 bool print_code = |
146 isolate->bootstrapper()->IsActive() | 146 isolate->bootstrapper()->IsActive() |
147 ? FLAG_print_builtin_code | 147 ? FLAG_print_builtin_code |
148 : (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) || | 148 : (FLAG_print_code || (info->IsStub() && FLAG_print_code_stubs) || |
149 (info->IsOptimizing() && FLAG_print_opt_code)); | 149 (info->IsOptimizing() && FLAG_print_opt_code && |
| 150 info->shared_info()->PassesFilter(FLAG_print_opt_code_filter))); |
150 if (print_code) { | 151 if (print_code) { |
151 std::unique_ptr<char[]> debug_name = info->GetDebugName(); | 152 std::unique_ptr<char[]> debug_name = info->GetDebugName(); |
152 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); | 153 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); |
153 OFStream os(tracing_scope.file()); | 154 OFStream os(tracing_scope.file()); |
154 | 155 |
155 // Print the source code if available. | 156 // Print the source code if available. |
156 bool print_source = | 157 bool print_source = |
157 info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || | 158 info->parse_info() && (code->kind() == Code::OPTIMIZED_FUNCTION || |
158 code->kind() == Code::FUNCTION); | 159 code->kind() == Code::FUNCTION); |
159 if (print_source) { | 160 if (print_source) { |
(...skipping 30 matching lines...) Expand all Loading... |
190 os << "source_position = " << shared->start_position() << "\n"; | 191 os << "source_position = " << shared->start_position() << "\n"; |
191 } | 192 } |
192 code->Disassemble(debug_name.get(), os); | 193 code->Disassemble(debug_name.get(), os); |
193 os << "--- End code ---\n"; | 194 os << "--- End code ---\n"; |
194 } | 195 } |
195 #endif // ENABLE_DISASSEMBLER | 196 #endif // ENABLE_DISASSEMBLER |
196 } | 197 } |
197 | 198 |
198 } // namespace internal | 199 } // namespace internal |
199 } // namespace v8 | 200 } // namespace v8 |
OLD | NEW |