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

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

Issue 1378523005: [Interpreter] Add support for global declarations and load/store of global variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_toplevel
Patch Set: Fix test Created 5 years, 2 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/unittests/compiler/interpreter-assembler-unittest.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 22 matching lines...) Expand all
33 .LoadUndefined() 33 .LoadUndefined()
34 .LoadNull() 34 .LoadNull()
35 .LoadTheHole() 35 .LoadTheHole()
36 .LoadTrue() 36 .LoadTrue()
37 .LoadFalse(); 37 .LoadFalse();
38 38
39 // Emit accumulator transfers. 39 // Emit accumulator transfers.
40 Register reg(0); 40 Register reg(0);
41 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); 41 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg);
42 42
43 // Emit global load operations. 43 // Emit global load / store operations.
44 builder.LoadGlobal(1); 44 builder.LoadGlobal(1);
45 builder.StoreGlobal(1, LanguageMode::SLOPPY);
46
47 // Emit context load operations.
48 builder.LoadContextSlot(reg, 1);
45 49
46 // Emit load / store property operations. 50 // Emit load / store property operations.
47 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) 51 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY)
48 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) 52 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY)
49 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) 53 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY)
50 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) 54 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY)
51 .LoadNamedProperty(reg, 0, LanguageMode::STRICT) 55 .LoadNamedProperty(reg, 0, LanguageMode::STRICT)
52 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT) 56 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT)
53 .StoreNamedProperty(reg, reg, 0, LanguageMode::STRICT) 57 .StoreNamedProperty(reg, reg, 0, LanguageMode::STRICT)
54 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); 58 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT);
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 446
443 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 447 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
444 iterator.Advance(); 448 iterator.Advance();
445 CHECK(iterator.done()); 449 CHECK(iterator.done());
446 } 450 }
447 451
448 452
449 } // namespace interpreter 453 } // namespace interpreter
450 } // namespace internal 454 } // namespace internal
451 } // namespace v8 455 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/interpreter-assembler-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698