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

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

Issue 2581683003: Introduce {ConstantElementsPair} struct for type safety. (Closed)
Patch Set: Rebased. Created 4 years 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
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 } 631 }
632 632
633 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral( 633 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateRegExpLiteral(
634 Handle<String> pattern, int literal_index, int flags) { 634 Handle<String> pattern, int literal_index, int flags) {
635 size_t pattern_entry = GetConstantPoolEntry(pattern); 635 size_t pattern_entry = GetConstantPoolEntry(pattern);
636 OutputCreateRegExpLiteral(pattern_entry, literal_index, flags); 636 OutputCreateRegExpLiteral(pattern_entry, literal_index, flags);
637 return *this; 637 return *this;
638 } 638 }
639 639
640 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral( 640 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateArrayLiteral(
641 Handle<FixedArray> constant_elements, int literal_index, int flags) { 641 Handle<ConstantElementsPair> constant_elements, int literal_index,
642 int flags) {
642 size_t constant_elements_entry = GetConstantPoolEntry(constant_elements); 643 size_t constant_elements_entry = GetConstantPoolEntry(constant_elements);
643 OutputCreateArrayLiteral(constant_elements_entry, literal_index, flags); 644 OutputCreateArrayLiteral(constant_elements_entry, literal_index, flags);
644 return *this; 645 return *this;
645 } 646 }
646 647
647 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral( 648 BytecodeArrayBuilder& BytecodeArrayBuilder::CreateObjectLiteral(
648 Handle<FixedArray> constant_properties, int literal_index, int flags, 649 Handle<FixedArray> constant_properties, int literal_index, int flags,
649 Register output) { 650 Register output) {
650 size_t constant_properties_entry = GetConstantPoolEntry(constant_properties); 651 size_t constant_properties_entry = GetConstantPoolEntry(constant_properties);
651 OutputCreateObjectLiteral(constant_properties_entry, literal_index, flags, 652 OutputCreateObjectLiteral(constant_properties_entry, literal_index, flags,
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 RegisterList reg_list) { 1035 RegisterList reg_list) {
1035 DCHECK(RegisterListIsValid(reg_list)); 1036 DCHECK(RegisterListIsValid(reg_list));
1036 if (register_optimizer_) 1037 if (register_optimizer_)
1037 register_optimizer_->PrepareOutputRegisterList(reg_list); 1038 register_optimizer_->PrepareOutputRegisterList(reg_list);
1038 return static_cast<uint32_t>(reg_list.first_register().ToOperand()); 1039 return static_cast<uint32_t>(reg_list.first_register().ToOperand());
1039 } 1040 }
1040 1041
1041 } // namespace interpreter 1042 } // namespace interpreter
1042 } // namespace internal 1043 } // namespace internal
1043 } // namespace v8 1044 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-array-builder.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698