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/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 AstPrinter(info->isolate()).PrintProgram(info->literal())); | 117 AstPrinter(info->isolate()).PrintProgram(info->literal())); |
118 } | 118 } |
119 #endif // DEBUG | 119 #endif // DEBUG |
120 } | 120 } |
121 | 121 |
122 | 122 |
123 Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, | 123 Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, |
124 CompilationInfo* info) { | 124 CompilationInfo* info) { |
125 Isolate* isolate = info->isolate(); | 125 Isolate* isolate = info->isolate(); |
126 | 126 |
127 Code::Flags flags; | |
128 if (info->IsStub() && info->code_stub()) { | |
129 DCHECK_EQ(info->output_code_kind(), info->code_stub()->GetCodeKind()); | |
130 flags = Code::ComputeFlags( | |
131 info->output_code_kind(), info->code_stub()->GetICState(), | |
132 info->code_stub()->GetExtraICState(), info->code_stub()->GetStubType()); | |
133 } else { | |
134 flags = Code::ComputeFlags(info->output_code_kind()); | |
135 } | |
136 | |
137 // Allocate and install the code. | 127 // Allocate and install the code. |
138 CodeDesc desc; | 128 CodeDesc desc; |
| 129 Code::Flags flags = info->code_flags(); |
139 bool is_crankshafted = | 130 bool is_crankshafted = |
140 Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION || | 131 Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION || |
141 info->IsStub(); | 132 info->IsStub(); |
142 masm->GetCode(&desc); | 133 masm->GetCode(&desc); |
143 Handle<Code> code = | 134 Handle<Code> code = |
144 isolate->factory()->NewCode(desc, flags, masm->CodeObject(), | 135 isolate->factory()->NewCode(desc, flags, masm->CodeObject(), |
145 false, is_crankshafted, | 136 false, is_crankshafted, |
146 info->prologue_offset(), | 137 info->prologue_offset(), |
147 info->is_debug() && !is_crankshafted); | 138 info->is_debug() && !is_crankshafted); |
148 isolate->counters()->total_compiled_code_size()->Increment( | 139 isolate->counters()->total_compiled_code_size()->Increment( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 os << "source_position = " << literal->start_position() << "\n"; | 195 os << "source_position = " << literal->start_position() << "\n"; |
205 } | 196 } |
206 code->Disassemble(debug_name.get(), os); | 197 code->Disassemble(debug_name.get(), os); |
207 os << "--- End code ---\n"; | 198 os << "--- End code ---\n"; |
208 } | 199 } |
209 #endif // ENABLE_DISASSEMBLER | 200 #endif // ENABLE_DISASSEMBLER |
210 } | 201 } |
211 | 202 |
212 } // namespace internal | 203 } // namespace internal |
213 } // namespace v8 | 204 } // namespace v8 |
OLD | NEW |