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

Side by Side Diff: test/unittests/interpreter/bytecode-dead-code-optimizer-unittest.cc

Issue 2242193002: [Interpreter] Avoid accessing Isolate from during bytecode generation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_sourceposition
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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-dead-code-optimizer.h" 7 #include "src/interpreter/bytecode-dead-code-optimizer.h"
8 #include "src/interpreter/bytecode-label.h" 8 #include "src/interpreter/bytecode-label.h"
9 #include "src/objects.h" 9 #include "src/objects.h"
10 #include "test/unittests/test-utils.h" 10 #include "test/unittests/test-utils.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override { 27 void WriteJump(BytecodeNode* node, BytecodeLabel* label) override {
28 write_count_++; 28 write_count_++;
29 last_written_.Clone(node); 29 last_written_.Clone(node);
30 } 30 }
31 31
32 void BindLabel(BytecodeLabel* label) override {} 32 void BindLabel(BytecodeLabel* label) override {}
33 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override {} 33 void BindLabel(const BytecodeLabel& target, BytecodeLabel* label) override {}
34 Handle<BytecodeArray> ToBytecodeArray( 34 Handle<BytecodeArray> ToBytecodeArray(
35 int fixed_register_count, int parameter_count, 35 Isolate* isolate, int fixed_register_count, int parameter_count,
36 Handle<FixedArray> handle_table) override { 36 Handle<FixedArray> handle_table) override {
37 return Handle<BytecodeArray>(); 37 return Handle<BytecodeArray>();
38 } 38 }
39 39
40 BytecodeDeadCodeOptimizer* optimizer() { return &dead_code_optimizer_; } 40 BytecodeDeadCodeOptimizer* optimizer() { return &dead_code_optimizer_; }
41 41
42 int write_count() const { return write_count_; } 42 int write_count() const { return write_count_; }
43 const BytecodeNode& last_written() const { return last_written_; } 43 const BytecodeNode& last_written() const { return last_written_; }
44 44
45 private: 45 private:
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 BytecodeNode add(Bytecode::kAdd, Register(0).ToOperand(), 1); 141 BytecodeNode add(Bytecode::kAdd, Register(0).ToOperand(), 1);
142 optimizer()->Write(&add); 142 optimizer()->Write(&add);
143 CHECK_EQ(write_count(), 2); 143 CHECK_EQ(write_count(), 2);
144 CHECK_EQ(add, last_written()); 144 CHECK_EQ(add, last_written());
145 } 145 }
146 146
147 } // namespace interpreter 147 } // namespace interpreter
148 } // namespace internal 148 } // namespace internal
149 } // namespace v8 149 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698