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

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

Issue 1419003002: [Interpreter] Unify global and unallocated variable access. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix unallocated variable error 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
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 25 matching lines...) Expand all
36 .LoadUndefined() 36 .LoadUndefined()
37 .LoadNull() 37 .LoadNull()
38 .LoadTheHole() 38 .LoadTheHole()
39 .LoadTrue() 39 .LoadTrue()
40 .LoadFalse(); 40 .LoadFalse();
41 41
42 // Emit accumulator transfers. 42 // Emit accumulator transfers.
43 Register reg(0); 43 Register reg(0);
44 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); 44 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg);
45 45
46 // Emit global load / store operations.
47 builder.LoadGlobal(0, 1, LanguageMode::SLOPPY)
48 .LoadGlobal(0, 1, LanguageMode::STRICT)
49 .StoreGlobal(0, 1, LanguageMode::SLOPPY)
50 .StoreGlobal(0, 1, LanguageMode::STRICT);
51
46 // Emit context operations. 52 // Emit context operations.
47 builder.PushContext(reg); 53 builder.PushContext(reg);
48 builder.PopContext(reg); 54 builder.PopContext(reg);
49 builder.LoadContextSlot(reg, 1); 55 builder.LoadContextSlot(reg, 1);
50 builder.StoreContextSlot(reg, 1); 56 builder.StoreContextSlot(reg, 1);
51 57
52 // Emit load / store property operations. 58 // Emit load / store property operations.
53 builder.LoadNamedProperty(reg, 0, LanguageMode::SLOPPY) 59 builder.LoadNamedProperty(reg, 0, 0, LanguageMode::SLOPPY)
54 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY) 60 .LoadKeyedProperty(reg, 0, LanguageMode::SLOPPY)
55 .StoreNamedProperty(reg, reg, 0, LanguageMode::SLOPPY) 61 .StoreNamedProperty(reg, 0, 0, LanguageMode::SLOPPY)
56 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY) 62 .StoreKeyedProperty(reg, reg, 0, LanguageMode::SLOPPY)
57 .LoadNamedProperty(reg, 0, LanguageMode::STRICT) 63 .LoadNamedProperty(reg, 0, 0, LanguageMode::STRICT)
58 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT) 64 .LoadKeyedProperty(reg, 0, LanguageMode::STRICT)
59 .StoreNamedProperty(reg, reg, 0, LanguageMode::STRICT) 65 .StoreNamedProperty(reg, 0, 0, LanguageMode::STRICT)
60 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT); 66 .StoreKeyedProperty(reg, reg, 0, LanguageMode::STRICT);
61 67
62 // Emit closure operations. 68 // Emit closure operations.
63 builder.CreateClosure(NOT_TENURED); 69 builder.CreateClosure(NOT_TENURED);
64 70
65 // Emit literal creation operations 71 // Emit literal creation operations
66 builder.CreateRegExpLiteral(0, reg) 72 builder.CreateRegExpLiteral(0, reg)
67 .CreateArrayLiteral(0, 0) 73 .CreateArrayLiteral(0, 0)
68 .CreateObjectLiteral(0, 0); 74 .CreateObjectLiteral(0, 0);
69 75
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 528
523 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 529 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
524 iterator.Advance(); 530 iterator.Advance();
525 CHECK(iterator.done()); 531 CHECK(iterator.done());
526 } 532 }
527 533
528 534
529 } // namespace interpreter 535 } // namespace interpreter
530 } // namespace internal 536 } // namespace internal
531 } // namespace v8 537 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-interpreter.cc ('k') | test/unittests/interpreter/bytecode-array-iterator-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698