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 #include "src/ast.h" | 7 #include "src/ast.h" |
8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 FullCodeGenerator cgen(&masm, info); | 303 FullCodeGenerator cgen(&masm, info); |
304 cgen.Generate(); | 304 cgen.Generate(); |
305 if (cgen.HasStackOverflow()) { | 305 if (cgen.HasStackOverflow()) { |
306 DCHECK(!isolate->has_pending_exception()); | 306 DCHECK(!isolate->has_pending_exception()); |
307 return false; | 307 return false; |
308 } | 308 } |
309 unsigned table_offset = cgen.EmitBackEdgeTable(); | 309 unsigned table_offset = cgen.EmitBackEdgeTable(); |
310 | 310 |
311 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); | 311 Code::Flags flags = Code::ComputeFlags(Code::FUNCTION); |
312 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); | 312 Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info); |
313 code->set_optimizable(info->IsOptimizable() && | |
314 !info->function()->dont_optimize() && | |
315 info->function()->scope()->AllowsLazyCompilation()); | |
316 cgen.PopulateDeoptimizationData(code); | 313 cgen.PopulateDeoptimizationData(code); |
317 cgen.PopulateTypeFeedbackInfo(code); | 314 cgen.PopulateTypeFeedbackInfo(code); |
318 code->set_has_deoptimization_support(info->HasDeoptimizationSupport()); | 315 code->set_has_deoptimization_support(info->HasDeoptimizationSupport()); |
319 code->set_has_reloc_info_for_serialization(info->will_serialize()); | 316 code->set_has_reloc_info_for_serialization(info->will_serialize()); |
320 code->set_handler_table(*cgen.handler_table()); | 317 code->set_handler_table(*cgen.handler_table()); |
321 code->set_compiled_optimizable(info->IsOptimizable()); | 318 code->set_compiled_optimizable(info->IsOptimizable()); |
322 code->set_allow_osr_at_loop_nesting_level(0); | 319 code->set_allow_osr_at_loop_nesting_level(0); |
323 code->set_profiler_ticks(0); | 320 code->set_profiler_ticks(0); |
324 code->set_back_edge_table_offset(table_offset); | 321 code->set_back_edge_table_offset(table_offset); |
325 CodeGenerator::PrintCode(code, info); | 322 CodeGenerator::PrintCode(code, info); |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 } | 1633 } |
1637 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); | 1634 codegen_->PrepareForBailoutForId(exit_id_, NO_REGISTERS); |
1638 codegen_->scope_ = saved_scope_; | 1635 codegen_->scope_ = saved_scope_; |
1639 } | 1636 } |
1640 | 1637 |
1641 | 1638 |
1642 #undef __ | 1639 #undef __ |
1643 | 1640 |
1644 | 1641 |
1645 } } // namespace v8::internal | 1642 } } // namespace v8::internal |
OLD | NEW |