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

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

Issue 1572283002: [Interpreter] Add wide context slot load / store operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address review comments. Created 4 years, 11 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/test-interpreter.cc ('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 "test/unittests/test-utils.h" 9 #include "test/unittests/test-utils.h"
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 Handle<String> name = factory->NewStringFromStaticChars("var_name"); 62 Handle<String> name = factory->NewStringFromStaticChars("var_name");
63 builder.LoadGlobal(name, 1, LanguageMode::SLOPPY, 63 builder.LoadGlobal(name, 1, LanguageMode::SLOPPY,
64 TypeofMode::NOT_INSIDE_TYPEOF) 64 TypeofMode::NOT_INSIDE_TYPEOF)
65 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF) 65 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF)
66 .LoadGlobal(name, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF) 66 .LoadGlobal(name, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF)
67 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF) 67 .LoadGlobal(name, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF)
68 .StoreGlobal(name, 1, LanguageMode::SLOPPY) 68 .StoreGlobal(name, 1, LanguageMode::SLOPPY)
69 .StoreGlobal(name, 1, LanguageMode::STRICT); 69 .StoreGlobal(name, 1, LanguageMode::STRICT);
70 70
71 // Emit context operations. 71 // Emit context operations.
72 builder.PushContext(reg); 72 builder.PushContext(reg)
73 builder.PopContext(reg); 73 .PopContext(reg)
74 builder.LoadContextSlot(reg, 1); 74 .LoadContextSlot(reg, 1)
75 builder.StoreContextSlot(reg, 1); 75 .StoreContextSlot(reg, 1);
76 76
77 // Emit load / store property operations. 77 // Emit load / store property operations.
78 builder.LoadNamedProperty(reg, name, 0, LanguageMode::SLOPPY) 78 builder.LoadNamedProperty(reg, name, 0, LanguageMode::SLOPPY)
79 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) 79 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY)
80 .StoreNamedProperty(reg, name, 0, LanguageMode::SLOPPY) 80 .StoreNamedProperty(reg, name, 0, LanguageMode::SLOPPY)
81 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) 81 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY)
82 .LoadNamedProperty(reg, name, 0, LanguageMode::STRICT) 82 .LoadNamedProperty(reg, name, 0, LanguageMode::STRICT)
83 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT) 83 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT)
84 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT) 84 .StoreNamedProperty(reg, name, 0, LanguageMode::STRICT)
85 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); 85 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // Emit wide load / store property operations. 234 // Emit wide load / store property operations.
235 builder.LoadNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY) 235 builder.LoadNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY)
236 .LoadKeyedProperty(reg, 2056, LanguageMode::SLOPPY) 236 .LoadKeyedProperty(reg, 2056, LanguageMode::SLOPPY)
237 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY) 237 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::SLOPPY)
238 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY) 238 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::SLOPPY)
239 .LoadNamedProperty(reg, wide_name, 0, LanguageMode::STRICT) 239 .LoadNamedProperty(reg, wide_name, 0, LanguageMode::STRICT)
240 .LoadKeyedProperty(reg, 2056, LanguageMode::STRICT) 240 .LoadKeyedProperty(reg, 2056, LanguageMode::STRICT)
241 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::STRICT) 241 .StoreNamedProperty(reg, wide_name, 0, LanguageMode::STRICT)
242 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT); 242 .StoreKeyedProperty(reg, reg, 2056, LanguageMode::STRICT);
243 243
244 // Emit wide context operations.
245 builder.LoadContextSlot(reg, 1024)
246 .StoreContextSlot(reg, 1024);
247
244 // Emit wide load / store lookup slots. 248 // Emit wide load / store lookup slots.
245 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF) 249 builder.LoadLookupSlot(wide_name, TypeofMode::NOT_INSIDE_TYPEOF)
246 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF) 250 .LoadLookupSlot(wide_name, TypeofMode::INSIDE_TYPEOF)
247 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY) 251 .StoreLookupSlot(wide_name, LanguageMode::SLOPPY)
248 .StoreLookupSlot(wide_name, LanguageMode::STRICT); 252 .StoreLookupSlot(wide_name, LanguageMode::STRICT);
249 253
250 // CreateClosureWide 254 // CreateClosureWide
251 Handle<SharedFunctionInfo> shared_info2 = factory->NewSharedFunctionInfo( 255 Handle<SharedFunctionInfo> shared_info2 = factory->NewSharedFunctionInfo(
252 factory->NewStringFromStaticChars("function_b"), MaybeHandle<Code>(), 256 factory->NewStringFromStaticChars("function_b"), MaybeHandle<Code>(),
253 false); 257 false);
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 } 708 }
705 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 709 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
706 iterator.Advance(); 710 iterator.Advance();
707 CHECK(iterator.done()); 711 CHECK(iterator.done());
708 } 712 }
709 713
710 714
711 } // namespace interpreter 715 } // namespace interpreter
712 } // namespace internal 716 } // namespace internal
713 } // namespace v8 717 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-interpreter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698