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

Side by Side Diff: test/unittests/interpreter/bytecode-array-builder-unittest.cc

Issue 2684993002: [interpreter] Create custom call opcodes for specific argument counts (Closed)
Patch Set: Fix golden files again Created 3 years, 9 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
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/RegExpLiterals.golden ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/interpreter/bytecode-array-builder.h" 8 #include "src/interpreter/bytecode-array-builder.h"
9 #include "src/interpreter/bytecode-array-iterator.h" 9 #include "src/interpreter/bytecode-array-iterator.h"
10 #include "src/interpreter/bytecode-label.h" 10 #include "src/interpreter/bytecode-label.h"
(...skipping 20 matching lines...) Expand all
31 DeclarationScope scope(zone(), &ast_factory); 31 DeclarationScope scope(zone(), &ast_factory);
32 32
33 CHECK_EQ(builder.locals_count(), 131); 33 CHECK_EQ(builder.locals_count(), 131);
34 CHECK_EQ(builder.context_count(), 1); 34 CHECK_EQ(builder.context_count(), 1);
35 CHECK_EQ(builder.fixed_register_count(), 132); 35 CHECK_EQ(builder.fixed_register_count(), 132);
36 36
37 Register reg(0); 37 Register reg(0);
38 Register other(reg.index() + 1); 38 Register other(reg.index() + 1);
39 Register wide(128); 39 Register wide(128);
40 RegisterList reg_list; 40 RegisterList reg_list;
41 RegisterList pair(0, 2), triple(0, 3); 41 RegisterList single(0, 1), pair(0, 2), triple(0, 3);
42 42
43 // Emit argument creation operations. 43 // Emit argument creation operations.
44 builder.CreateArguments(CreateArgumentsType::kMappedArguments) 44 builder.CreateArguments(CreateArgumentsType::kMappedArguments)
45 .CreateArguments(CreateArgumentsType::kUnmappedArguments) 45 .CreateArguments(CreateArgumentsType::kUnmappedArguments)
46 .CreateArguments(CreateArgumentsType::kRestParameter); 46 .CreateArguments(CreateArgumentsType::kRestParameter);
47 47
48 // Emit constant loads. 48 // Emit constant loads.
49 builder.LoadLiteral(Smi::kZero) 49 builder.LoadLiteral(Smi::kZero)
50 .StoreAccumulatorInRegister(reg) 50 .StoreAccumulatorInRegister(reg)
51 .LoadLiteral(Smi::FromInt(8)) 51 .LoadLiteral(Smi::FromInt(8))
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 builder.CreateEvalContext(1); 137 builder.CreateEvalContext(1);
138 builder.CreateWithContext(reg, &scope); 138 builder.CreateWithContext(reg, &scope);
139 139
140 // Emit literal creation operations. 140 // Emit literal creation operations.
141 builder.CreateRegExpLiteral(ast_factory.GetOneByteString("a"), 0, 0); 141 builder.CreateRegExpLiteral(ast_factory.GetOneByteString("a"), 0, 0);
142 builder.CreateArrayLiteral(0, 0, 0); 142 builder.CreateArrayLiteral(0, 0, 0);
143 builder.CreateObjectLiteral(0, 0, 0, reg); 143 builder.CreateObjectLiteral(0, 0, 0, reg);
144 144
145 // Call operations. 145 // Call operations.
146 builder.Call(reg, reg_list, 1, Call::GLOBAL_CALL) 146 builder.Call(reg, reg_list, 1, Call::GLOBAL_CALL)
147 .Call(reg, single, 1, Call::GLOBAL_CALL)
148 .Call(reg, pair, 1, Call::GLOBAL_CALL)
149 .Call(reg, triple, 1, Call::GLOBAL_CALL)
147 .Call(reg, reg_list, 1, Call::NAMED_PROPERTY_CALL, 150 .Call(reg, reg_list, 1, Call::NAMED_PROPERTY_CALL,
148 TailCallMode::kDisallow) 151 TailCallMode::kDisallow)
152 .Call(reg, single, 1, Call::NAMED_PROPERTY_CALL)
153 .Call(reg, pair, 1, Call::NAMED_PROPERTY_CALL)
154 .Call(reg, triple, 1, Call::NAMED_PROPERTY_CALL)
149 .Call(reg, reg_list, 1, Call::GLOBAL_CALL, TailCallMode::kAllow) 155 .Call(reg, reg_list, 1, Call::GLOBAL_CALL, TailCallMode::kAllow)
150 .CallRuntime(Runtime::kIsArray, reg) 156 .CallRuntime(Runtime::kIsArray, reg)
151 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg_list, pair) 157 .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, reg_list, pair)
152 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg_list) 158 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg_list)
153 .CallWithSpread(reg, reg_list); 159 .CallWithSpread(reg, reg_list);
154 160
155 // Emit binary operator invocations. 161 // Emit binary operator invocations.
156 builder.BinaryOperation(Token::Value::ADD, reg, 1) 162 builder.BinaryOperation(Token::Value::ADD, reg, 1)
157 .BinaryOperation(Token::Value::SUB, reg, 2) 163 .BinaryOperation(Token::Value::SUB, reg, 2)
158 .BinaryOperation(Token::Value::MUL, reg, 3) 164 .BinaryOperation(Token::Value::MUL, reg, 3)
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 iterator.Advance(); 781 iterator.Advance();
776 } 782 }
777 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 783 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
778 iterator.Advance(); 784 iterator.Advance();
779 CHECK(iterator.done()); 785 CHECK(iterator.done());
780 } 786 }
781 787
782 } // namespace interpreter 788 } // namespace interpreter
783 } // namespace internal 789 } // namespace internal
784 } // namespace v8 790 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/RegExpLiterals.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698