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> | 8 #include <fenv.h> |
9 #endif | 9 #endif |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 if (info->parse_info() && print_ast) { | 143 if (info->parse_info() && print_ast) { |
144 PrintF("--- AST ---\n%s\n", AstPrinter(info->isolate(), info->zone()) | 144 PrintF("--- AST ---\n%s\n", AstPrinter(info->isolate(), info->zone()) |
145 .PrintProgram(info->literal())); | 145 .PrintProgram(info->literal())); |
146 } | 146 } |
147 #endif // DEBUG | 147 #endif // DEBUG |
148 } | 148 } |
149 | 149 |
150 | 150 |
151 Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, | 151 Handle<Code> CodeGenerator::MakeCodeEpilogue(MacroAssembler* masm, |
152 Code::Flags flags, | |
153 CompilationInfo* info) { | 152 CompilationInfo* info) { |
154 Isolate* isolate = info->isolate(); | 153 Isolate* isolate = info->isolate(); |
155 | 154 |
| 155 Code::Flags flags = |
| 156 info->code_stub() != nullptr |
| 157 ? Code::ComputeFlags(info->code_stub()->GetCodeKind(), |
| 158 info->code_stub()->GetICState(), |
| 159 info->code_stub()->GetExtraICState(), |
| 160 info->code_stub()->GetStubType()) |
| 161 : Code::ComputeFlags(info->IsOptimizing() ? Code::OPTIMIZED_FUNCTION |
| 162 : Code::FUNCTION); |
| 163 |
156 // Allocate and install the code. | 164 // Allocate and install the code. |
157 CodeDesc desc; | 165 CodeDesc desc; |
158 bool is_crankshafted = | 166 bool is_crankshafted = |
159 Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION || | 167 Code::ExtractKindFromFlags(flags) == Code::OPTIMIZED_FUNCTION || |
160 info->IsStub(); | 168 info->IsStub(); |
161 masm->GetCode(&desc); | 169 masm->GetCode(&desc); |
162 Handle<Code> code = | 170 Handle<Code> code = |
163 isolate->factory()->NewCode(desc, flags, masm->CodeObject(), | 171 isolate->factory()->NewCode(desc, flags, masm->CodeObject(), |
164 false, is_crankshafted, | 172 false, is_crankshafted, |
165 info->prologue_offset(), | 173 info->prologue_offset(), |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 os << "source_position = " << literal->start_position() << "\n"; | 240 os << "source_position = " << literal->start_position() << "\n"; |
233 } | 241 } |
234 code->Disassemble(debug_name, os); | 242 code->Disassemble(debug_name, os); |
235 os << "--- End code ---\n"; | 243 os << "--- End code ---\n"; |
236 } | 244 } |
237 #endif // ENABLE_DISASSEMBLER | 245 #endif // ENABLE_DISASSEMBLER |
238 } | 246 } |
239 | 247 |
240 } // namespace internal | 248 } // namespace internal |
241 } // namespace v8 | 249 } // namespace v8 |
OLD | NEW |