| 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 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 .PrintProgram(info->literal())); | 137 .PrintProgram(info->literal())); |
| 138 } | 138 } |
| 139 #endif // DEBUG | 139 #endif // DEBUG |
| 140 } | 140 } |
| 141 | 141 |
| 142 | 142 |
| 143 Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, | 143 Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, |
| 144 CompilationInfo* info) { | 144 CompilationInfo* info) { |
| 145 Isolate* isolate = info->isolate(); | 145 Isolate* isolate = info->isolate(); |
| 146 | 146 |
| 147 Code::Flags flags = | 147 Code::Flags flags; |
| 148 info->IsStub() | 148 if (info->IsStub() && info->code_stub()) { |
| 149 ? info->code_stub() | 149 DCHECK_EQ(info->output_code_kind(), info->code_stub()->GetCodeKind()); |
| 150 ? Code::ComputeFlags(info->code_stub()->GetCodeKind(), | 150 flags = Code::ComputeFlags( |
| 151 info->code_stub()->GetICState(), | 151 info->output_code_kind(), info->code_stub()->GetICState(), |
| 152 info->code_stub()->GetExtraICState(), | 152 info->code_stub()->GetExtraICState(), info->code_stub()->GetStubType()); |
| 153 info->code_stub()->GetStubType()) | 153 } else { |
| 154 : Code::ComputeFlags(Code::STUB) | 154 flags = Code::ComputeFlags(info->output_code_kind()); |
| 155 : Code::ComputeFlags(info->IsOptimizing() ? Code::OPTIMIZED_FUNCTION | 155 } |
| 156 : Code::FUNCTION); | |
| 157 | 156 |
| 158 // Allocate and install the code. | 157 // Allocate and install the code. |
| 159 CodeDesc desc; | 158 CodeDesc desc; |
| 160 bool is_crankshafted = | 159 bool is_crankshafted = |
| 161 Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION || | 160 Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION || |
| 162 info->IsStub(); | 161 info->IsStub(); |
| 163 masm->GetCode(&desc); | 162 masm->GetCode(&desc); |
| 164 Handle<Code> code = | 163 Handle<Code> code = |
| 165 isolate->factory()->NewCode(desc, flags, masm->CodeObject(), | 164 isolate->factory()->NewCode(desc, flags, masm->CodeObject(), |
| 166 false, is_crankshafted, | 165 false, is_crankshafted, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 os << "source_position = " << literal->start_position() << "\n"; | 224 os << "source_position = " << literal->start_position() << "\n"; |
| 226 } | 225 } |
| 227 code->Disassemble(debug_name.get(), os); | 226 code->Disassemble(debug_name.get(), os); |
| 228 os << "--- End code ---\n"; | 227 os << "--- End code ---\n"; |
| 229 } | 228 } |
| 230 #endif // ENABLE_DISASSEMBLER | 229 #endif // ENABLE_DISASSEMBLER |
| 231 } | 230 } |
| 232 | 231 |
| 233 } // namespace internal | 232 } // namespace internal |
| 234 } // namespace v8 | 233 } // namespace v8 |
| OLD | NEW |