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

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

Issue 2187523002: [interpreter] Add CreateFunctionContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fncontextstubslotparam
Patch Set: fix bytecode graph builder Created 4 years, 4 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/LookupSlot.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/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 "src/interpreter/bytecode-label.h" 9 #include "src/interpreter/bytecode-label.h"
10 #include "src/interpreter/bytecode-register-allocator.h" 10 #include "src/interpreter/bytecode-register-allocator.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 .LoadLookupSlot(name, TypeofMode::INSIDE_TYPEOF) 97 .LoadLookupSlot(name, TypeofMode::INSIDE_TYPEOF)
98 .StoreLookupSlot(name, LanguageMode::SLOPPY) 98 .StoreLookupSlot(name, LanguageMode::SLOPPY)
99 .StoreLookupSlot(name, LanguageMode::STRICT); 99 .StoreLookupSlot(name, LanguageMode::STRICT);
100 100
101 // Emit closure operations. 101 // Emit closure operations.
102 Handle<SharedFunctionInfo> shared_info = factory->NewSharedFunctionInfo( 102 Handle<SharedFunctionInfo> shared_info = factory->NewSharedFunctionInfo(
103 factory->NewStringFromStaticChars("function_a"), MaybeHandle<Code>(), 103 factory->NewStringFromStaticChars("function_a"), MaybeHandle<Code>(),
104 false); 104 false);
105 builder.CreateClosure(shared_info, NOT_TENURED); 105 builder.CreateClosure(shared_info, NOT_TENURED);
106 106
107 // Emit create context operation.
108 builder.CreateFunctionContext(1);
109
107 // Emit literal creation operations. 110 // Emit literal creation operations.
108 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0) 111 builder.CreateRegExpLiteral(factory->NewStringFromStaticChars("a"), 0, 0)
109 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0) 112 .CreateArrayLiteral(factory->NewFixedArray(1), 0, 0)
110 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0); 113 .CreateObjectLiteral(factory->NewFixedArray(1), 0, 0);
111 114
112 // Call operations. 115 // Call operations.
113 builder.Call(reg, other, 0, 1) 116 builder.Call(reg, other, 0, 1)
114 .Call(reg, wide, 0, 1) 117 .Call(reg, wide, 0, 1)
115 .TailCall(reg, other, 0, 1) 118 .TailCall(reg, other, 0, 1)
116 .TailCall(reg, wide, 0, 1) 119 .TailCall(reg, wide, 0, 1)
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 iterator.Advance(); 845 iterator.Advance();
843 } 846 }
844 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 847 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
845 iterator.Advance(); 848 iterator.Advance();
846 CHECK(iterator.done()); 849 CHECK(iterator.done());
847 } 850 }
848 851
849 } // namespace interpreter 852 } // namespace interpreter
850 } // namespace internal 853 } // namespace internal
851 } // namespace v8 854 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/LookupSlot.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698