OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/interpreter/bytecode-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 | 6 |
7 #include "src/globals.h" | 7 #include "src/globals.h" |
8 #include "src/interpreter/bytecode-array-writer.h" | 8 #include "src/interpreter/bytecode-array-writer.h" |
9 #include "src/interpreter/bytecode-dead-code-optimizer.h" | 9 #include "src/interpreter/bytecode-dead-code-optimizer.h" |
10 #include "src/interpreter/bytecode-label.h" | 10 #include "src/interpreter/bytecode-label.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 if (FLAG_ignition_peephole) { | 44 if (FLAG_ignition_peephole) { |
45 pipeline_ = new (zone) BytecodePeepholeOptimizer(pipeline_); | 45 pipeline_ = new (zone) BytecodePeepholeOptimizer(pipeline_); |
46 } | 46 } |
47 | 47 |
48 if (FLAG_ignition_reo) { | 48 if (FLAG_ignition_reo) { |
49 register_optimizer_ = new (zone) BytecodeRegisterOptimizer( | 49 register_optimizer_ = new (zone) BytecodeRegisterOptimizer( |
50 zone, ®ister_allocator_, fixed_register_count(), parameter_count, | 50 zone, ®ister_allocator_, fixed_register_count(), parameter_count, |
51 pipeline_); | 51 pipeline_); |
52 } | 52 } |
53 | 53 |
54 return_position_ = | 54 return_position_ = literal ? literal->return_position() : kNoSourcePosition; |
55 literal ? std::max(literal->start_position(), literal->end_position() - 1) | |
56 : kNoSourcePosition; | |
57 } | 55 } |
58 | 56 |
59 Register BytecodeArrayBuilder::first_context_register() const { | 57 Register BytecodeArrayBuilder::first_context_register() const { |
60 DCHECK_GT(context_register_count_, 0); | 58 DCHECK_GT(context_register_count_, 0); |
61 return Register(local_register_count_); | 59 return Register(local_register_count_); |
62 } | 60 } |
63 | 61 |
64 Register BytecodeArrayBuilder::last_context_register() const { | 62 Register BytecodeArrayBuilder::last_context_register() const { |
65 DCHECK_GT(context_register_count_, 0); | 63 DCHECK_GT(context_register_count_, 0); |
66 return Register(local_register_count_ + context_register_count_ - 1); | 64 return Register(local_register_count_ + context_register_count_ - 1); |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 RegisterList reg_list) { | 1003 RegisterList reg_list) { |
1006 DCHECK(RegisterListIsValid(reg_list)); | 1004 DCHECK(RegisterListIsValid(reg_list)); |
1007 if (register_optimizer_) | 1005 if (register_optimizer_) |
1008 register_optimizer_->PrepareOutputRegisterList(reg_list); | 1006 register_optimizer_->PrepareOutputRegisterList(reg_list); |
1009 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); | 1007 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); |
1010 } | 1008 } |
1011 | 1009 |
1012 } // namespace interpreter | 1010 } // namespace interpreter |
1013 } // namespace internal | 1011 } // namespace internal |
1014 } // namespace v8 | 1012 } // namespace v8 |
OLD | NEW |