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

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

Issue 1422443006: [Intepreter] Don't throw reference errors for globals in typeof. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 5 years, 1 month 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 26 matching lines...) Expand all
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. 46 // Emit global load / store operations.
47 builder.LoadGlobal(0, 1, LanguageMode::SLOPPY) 47 builder.LoadGlobal(0, 1, LanguageMode::SLOPPY, TypeofMode::NOT_INSIDE_TYPEOF)
48 .LoadGlobal(0, 1, LanguageMode::STRICT) 48 .LoadGlobal(0, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF)
49 .LoadGlobal(0, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF)
50 .LoadGlobal(0, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF)
49 .StoreGlobal(0, 1, LanguageMode::SLOPPY) 51 .StoreGlobal(0, 1, LanguageMode::SLOPPY)
50 .StoreGlobal(0, 1, LanguageMode::STRICT); 52 .StoreGlobal(0, 1, LanguageMode::STRICT);
51 53
52 // Emit wide global load / store operations. 54 // Emit wide global load / store operations.
53 builder.LoadGlobal(0, 1024, LanguageMode::SLOPPY) 55 builder.LoadGlobal(0, 1024, LanguageMode::SLOPPY,
54 .LoadGlobal(1024, 1, LanguageMode::STRICT) 56 TypeofMode::NOT_INSIDE_TYPEOF)
57 .LoadGlobal(1024, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF)
58 .LoadGlobal(0, 1024, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF)
59 .LoadGlobal(1024, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF)
55 .StoreGlobal(0, 1024, LanguageMode::SLOPPY) 60 .StoreGlobal(0, 1024, LanguageMode::SLOPPY)
56 .StoreGlobal(1024, 1, LanguageMode::STRICT); 61 .StoreGlobal(1024, 1, LanguageMode::STRICT);
57 62
58 // Emit context operations. 63 // Emit context operations.
59 builder.PushContext(reg); 64 builder.PushContext(reg);
60 builder.PopContext(reg); 65 builder.PopContext(reg);
61 builder.LoadContextSlot(reg, 1); 66 builder.LoadContextSlot(reg, 1);
62 builder.StoreContextSlot(reg, 1); 67 builder.StoreContextSlot(reg, 1);
63 68
64 // Emit load / store property operations. 69 // Emit load / store property operations.
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 697
693 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 698 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
694 iterator.Advance(); 699 iterator.Advance();
695 CHECK(iterator.done()); 700 CHECK(iterator.done());
696 } 701 }
697 702
698 703
699 } // namespace interpreter 704 } // namespace interpreter
700 } // namespace internal 705 } // namespace internal
701 } // namespace v8 706 } // 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