| 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if defined(V8_OS_AIX) | 7 #if defined(V8_OS_AIX) |
| 8 #include <fenv.h> | 8 #include <fenv.h> |
| 9 #endif | 9 #endif |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { | 176 void CodeGenerator::PrintCode(Handle<Code> code, CompilationInfo* info) { |
| 177 #ifdef ENABLE_DISASSEMBLER | 177 #ifdef ENABLE_DISASSEMBLER |
| 178 AllowDeferredHandleDereference allow_deference_for_print_code; | 178 AllowDeferredHandleDereference allow_deference_for_print_code; |
| 179 bool print_code = info->isolate()->bootstrapper()->IsActive() | 179 bool print_code = info->isolate()->bootstrapper()->IsActive() |
| 180 ? FLAG_print_builtin_code | 180 ? FLAG_print_builtin_code |
| 181 : (FLAG_print_code || | 181 : (FLAG_print_code || |
| 182 (info->IsStub() && FLAG_print_code_stubs) || | 182 (info->IsStub() && FLAG_print_code_stubs) || |
| 183 (info->IsOptimizing() && FLAG_print_opt_code)); | 183 (info->IsOptimizing() && FLAG_print_opt_code)); |
| 184 if (print_code) { | 184 if (print_code) { |
| 185 const char* debug_name; | 185 const char* debug_name; |
| 186 SmartArrayPointer<char> debug_name_holder; | 186 base::SmartArrayPointer<char> debug_name_holder; |
| 187 if (info->IsStub()) { | 187 if (info->IsStub()) { |
| 188 CodeStub::Major major_key = info->code_stub()->MajorKey(); | 188 CodeStub::Major major_key = info->code_stub()->MajorKey(); |
| 189 debug_name = CodeStub::MajorName(major_key, false); | 189 debug_name = CodeStub::MajorName(major_key, false); |
| 190 } else { | 190 } else { |
| 191 debug_name_holder = | 191 debug_name_holder = |
| 192 info->parse_info()->function()->debug_name()->ToCString(); | 192 info->parse_info()->function()->debug_name()->ToCString(); |
| 193 debug_name = debug_name_holder.get(); | 193 debug_name = debug_name_holder.get(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); | 196 CodeTracer::Scope tracing_scope(info->isolate()->GetCodeTracer()); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 os << "source_position = " << function->start_position() << "\n"; | 234 os << "source_position = " << function->start_position() << "\n"; |
| 235 } | 235 } |
| 236 code->Disassemble(debug_name, os); | 236 code->Disassemble(debug_name, os); |
| 237 os << "--- End code ---\n"; | 237 os << "--- End code ---\n"; |
| 238 } | 238 } |
| 239 #endif // ENABLE_DISASSEMBLER | 239 #endif // ENABLE_DISASSEMBLER |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace internal | 242 } // namespace internal |
| 243 } // namespace v8 | 243 } // namespace v8 |
| OLD | NEW |