Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(413)

Side by Side Diff: src/interpreter/bytecode-array-builder.cc

Issue 1997653002: [interpreter] Bytecode register optimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Grammar. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/compiler.h" 7 #include "src/compiler.h"
8 #include "src/interpreter/bytecode-array-writer.h" 8 #include "src/interpreter/bytecode-array-writer.h"
9 #include "src/interpreter/bytecode-peephole-optimizer.h" 9 #include "src/interpreter/bytecode-peephole-optimizer.h"
10 #include "src/interpreter/bytecode-register-optimizer.h"
10 #include "src/interpreter/interpreter-intrinsics.h" 11 #include "src/interpreter/interpreter-intrinsics.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 namespace interpreter { 15 namespace interpreter {
15 16
16 BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone, 17 BytecodeArrayBuilder::BytecodeArrayBuilder(Isolate* isolate, Zone* zone,
17 int parameter_count, 18 int parameter_count,
18 int context_count, int locals_count, 19 int context_count, int locals_count,
19 FunctionLiteral* literal) 20 FunctionLiteral* literal)
(...skipping 13 matching lines...) Expand all
33 pipeline_(&bytecode_array_writer_) { 34 pipeline_(&bytecode_array_writer_) {
34 DCHECK_GE(parameter_count_, 0); 35 DCHECK_GE(parameter_count_, 0);
35 DCHECK_GE(context_register_count_, 0); 36 DCHECK_GE(context_register_count_, 0);
36 DCHECK_GE(local_register_count_, 0); 37 DCHECK_GE(local_register_count_, 0);
37 38
38 if (FLAG_ignition_peephole) { 39 if (FLAG_ignition_peephole) {
39 pipeline_ = new (zone) 40 pipeline_ = new (zone)
40 BytecodePeepholeOptimizer(&constant_array_builder_, pipeline_); 41 BytecodePeepholeOptimizer(&constant_array_builder_, pipeline_);
41 } 42 }
42 43
44 if (FLAG_ignition_reo) {
45 pipeline_ = new (zone)
46 BytecodeRegisterOptimizer(zone, &temporary_allocator_, parameter_count,
47 fixed_register_count(), pipeline_);
48 }
49
43 return_position_ = 50 return_position_ =
44 literal ? std::max(literal->start_position(), literal->end_position() - 1) 51 literal ? std::max(literal->start_position(), literal->end_position() - 1)
45 : RelocInfo::kNoPosition; 52 : RelocInfo::kNoPosition;
46 LOG_CODE_EVENT(isolate_, CodeStartLinePosInfoRecordEvent( 53 LOG_CODE_EVENT(isolate_, CodeStartLinePosInfoRecordEvent(
47 source_position_table_builder())); 54 source_position_table_builder()));
48 } 55 }
49 56
50 Register BytecodeArrayBuilder::first_context_register() const { 57 Register BytecodeArrayBuilder::first_context_register() const {
51 DCHECK_GT(context_register_count_, 0); 58 DCHECK_GT(context_register_count_, 0);
52 return Register(local_register_count_); 59 return Register(local_register_count_);
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 } 1293 }
1287 1294
1288 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) { 1295 uint32_t BytecodeArrayBuilder::UnsignedOperand(size_t value) {
1289 DCHECK_LE(value, kMaxUInt32); 1296 DCHECK_LE(value, kMaxUInt32);
1290 return static_cast<uint32_t>(value); 1297 return static_cast<uint32_t>(value);
1291 } 1298 }
1292 1299
1293 } // namespace interpreter 1300 } // namespace interpreter
1294 } // namespace internal 1301 } // namespace internal
1295 } // namespace v8 1302 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698