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

Unified Diff: test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc

Issue 2238853002: [Interpreter] Remove LdaConstant+ToName peephole optimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_internalize
Patch Set: Address comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
diff --git a/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc b/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
index 0fc97b9185b883688d9c3e5f2e4513a273e0e4a5..f8f599d3f121f59bd3ad87ff404b0f0ed8133b37 100644
--- a/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
+++ b/test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc
@@ -7,7 +7,6 @@
#include "src/factory.h"
#include "src/interpreter/bytecode-label.h"
#include "src/interpreter/bytecode-peephole-optimizer.h"
-#include "src/interpreter/constant-array-builder.h"
#include "src/objects-inl.h"
#include "src/objects.h"
#include "test/unittests/test-utils.h"
@@ -19,9 +18,7 @@ namespace interpreter {
class BytecodePeepholeOptimizerTest : public BytecodePipelineStage,
public TestWithIsolateAndZone {
public:
- BytecodePeepholeOptimizerTest()
- : constant_array_builder_(isolate(), zone()),
- peephole_optimizer_(&constant_array_builder_, this) {}
+ BytecodePeepholeOptimizerTest() : peephole_optimizer_(this) {}
~BytecodePeepholeOptimizerTest() override {}
void Reset() {
@@ -52,13 +49,11 @@ class BytecodePeepholeOptimizerTest : public BytecodePipelineStage,
}
BytecodePeepholeOptimizer* optimizer() { return &peephole_optimizer_; }
- ConstantArrayBuilder* constant_array() { return &constant_array_builder_; }
int write_count() const { return write_count_; }
const BytecodeNode& last_written() const { return last_written_; }
private:
- ConstantArrayBuilder constant_array_builder_;
BytecodePeepholeOptimizer peephole_optimizer_;
int write_count_ = 0;
@@ -266,38 +261,6 @@ TEST_F(BytecodePeepholeOptimizerTest, TypeOfToName) {
CHECK_EQ(last_written().bytecode(), Bytecode::kStar);
}
-TEST_F(BytecodePeepholeOptimizerTest, LdaConstantStringToName) {
- Handle<Object> word =
- isolate()->factory()->NewStringFromStaticChars("optimizing");
- size_t index = constant_array()->Insert(word);
- BytecodeNode first(Bytecode::kLdaConstant, static_cast<uint32_t>(index));
- BytecodeNode second(Bytecode::kToName, Register(0).ToOperand());
- optimizer()->Write(&first);
- CHECK_EQ(write_count(), 0);
- optimizer()->Write(&second);
- CHECK_EQ(write_count(), 1);
- CHECK_EQ(last_written(), first);
- Flush();
- CHECK_EQ(write_count(), 2);
- CHECK_EQ(last_written(), second);
- CHECK_EQ(last_written().bytecode(), Bytecode::kStar);
-}
-
-TEST_F(BytecodePeepholeOptimizerTest, LdaConstantNumberToName) {
- Handle<Object> word = isolate()->factory()->NewNumber(0.380);
- size_t index = constant_array()->Insert(word);
- BytecodeNode first(Bytecode::kLdaConstant, static_cast<uint32_t>(index));
- BytecodeNode second(Bytecode::kToName, Register(0).ToOperand());
- optimizer()->Write(&first);
- CHECK_EQ(write_count(), 0);
- optimizer()->Write(&second);
- CHECK_EQ(write_count(), 1);
- CHECK_EQ(last_written(), first);
- Flush();
- CHECK_EQ(write_count(), 2);
- CHECK_EQ(last_written(), second);
-}
-
// Tests covering BytecodePeepholeOptimizer::CanElideLast().
TEST_F(BytecodePeepholeOptimizerTest, LdaTrueLdaFalse) {
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698