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

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

Issue 1435283002: [Interpreter] Adds an optimization to remove redundant Ldar/Star. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased the patch 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-bytecode-generator.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 21 matching lines...) Expand all
32 // Emit constant loads. 32 // Emit constant loads.
33 builder.LoadLiteral(Smi::FromInt(0)) 33 builder.LoadLiteral(Smi::FromInt(0))
34 .LoadLiteral(Smi::FromInt(8)) 34 .LoadLiteral(Smi::FromInt(8))
35 .LoadLiteral(Smi::FromInt(10000000)) 35 .LoadLiteral(Smi::FromInt(10000000))
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. Stores followed by loads to the same register
43 // are not generated. Hence, a dummy instruction in between.
43 Register reg(0); 44 Register reg(0);
44 builder.LoadAccumulatorWithRegister(reg).StoreAccumulatorInRegister(reg); 45 builder.LoadAccumulatorWithRegister(reg)
46 .LoadNull()
47 .StoreAccumulatorInRegister(reg);
45 48
46 // Emit global load / store operations. 49 // Emit global load / store operations.
47 builder.LoadGlobal(0, 1, LanguageMode::SLOPPY, TypeofMode::NOT_INSIDE_TYPEOF) 50 builder.LoadGlobal(0, 1, LanguageMode::SLOPPY, TypeofMode::NOT_INSIDE_TYPEOF)
48 .LoadGlobal(0, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF) 51 .LoadGlobal(0, 1, LanguageMode::STRICT, TypeofMode::NOT_INSIDE_TYPEOF)
49 .LoadGlobal(0, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF) 52 .LoadGlobal(0, 1, LanguageMode::SLOPPY, TypeofMode::INSIDE_TYPEOF)
50 .LoadGlobal(0, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF) 53 .LoadGlobal(0, 1, LanguageMode::STRICT, TypeofMode::INSIDE_TYPEOF)
51 .StoreGlobal(0, 1, LanguageMode::SLOPPY) 54 .StoreGlobal(0, 1, LanguageMode::SLOPPY)
52 .StoreGlobal(0, 1, LanguageMode::STRICT); 55 .StoreGlobal(0, 1, LanguageMode::STRICT);
53 56
54 // Emit wide global load / store operations. 57 // Emit wide global load / store operations.
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 701
699 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn); 702 CHECK_EQ(iterator.current_bytecode(), Bytecode::kReturn);
700 iterator.Advance(); 703 iterator.Advance();
701 CHECK(iterator.done()); 704 CHECK(iterator.done());
702 } 705 }
703 706
704 707
705 } // namespace interpreter 708 } // namespace interpreter
706 } // namespace internal 709 } // namespace internal
707 } // namespace v8 710 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/interpreter/test-bytecode-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698