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

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

Issue 1503963002: [Interpreter] Adds wide variant of CreateLiterals. Adds CreateLiterals to BytecodeGraphBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
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/interpreter/bytecode-array-builder.h" 7 #include "src/interpreter/bytecode-array-builder.h"
8 #include "src/interpreter/bytecode-array-iterator.h" 8 #include "src/interpreter/bytecode-array-iterator.h"
9 #include "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 Factory* factory = isolate()->factory(); 97 Factory* factory = isolate()->factory();
98 Handle<SharedFunctionInfo> shared_info = factory->NewSharedFunctionInfo( 98 Handle<SharedFunctionInfo> shared_info = factory->NewSharedFunctionInfo(
99 factory->NewStringFromStaticChars("function_a"), MaybeHandle<Code>(), 99 factory->NewStringFromStaticChars("function_a"), MaybeHandle<Code>(),
100 false); 100 false);
101 builder.CreateClosure(shared_info, NOT_TENURED); 101 builder.CreateClosure(shared_info, NOT_TENURED);
102 102
103 // Emit argument creation operations. 103 // Emit argument creation operations.
104 builder.CreateArguments(CreateArgumentsType::kMappedArguments) 104 builder.CreateArguments(CreateArgumentsType::kMappedArguments)
105 .CreateArguments(CreateArgumentsType::kUnmappedArguments); 105 .CreateArguments(CreateArgumentsType::kUnmappedArguments);
106 106
107 // Emit literal creation operations 107 // Emit literal creation operations.
108 builder.CreateRegExpLiteral(0, 0) 108 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0)
109 .CreateArrayLiteral(0, 0) 109 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0)
110 .CreateObjectLiteral(0, 0); 110 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0);
111 111
112 // Call operations. 112 // Call operations.
113 builder.Call(reg, reg, 0, 0) 113 builder.Call(reg, reg, 0, 0)
114 .Call(reg, reg, 0, 1024) 114 .Call(reg, reg, 0, 1024)
115 .CallRuntime(Runtime::kIsArray, reg, 1) 115 .CallRuntime(Runtime::kIsArray, reg, 1)
116 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1); 116 .CallJSRuntime(Context::SPREAD_ITERABLE_INDEX, reg, 1);
117 117
118 // Emit binary operator invocations. 118 // Emit binary operator invocations.
119 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK) 119 builder.BinaryOperation(Token::Value::ADD, reg, Strength::WEAK)
120 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK) 120 .BinaryOperation(Token::Value::SUB, reg, Strength::WEAK)
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 716
717 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 717 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
718 iterator.Advance(); 718 iterator.Advance();
719 CHECK(iterator.done()); 719 CHECK(iterator.done());
720 } 720 }
721 721
722 722
723 } // namespace interpreter 723 } // namespace interpreter
724 } // namespace internal 724 } // namespace internal
725 } // namespace v8 725 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698