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

Side by Side Diff: src/interpreter/interpreter.cc

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 years, 8 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
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/isolate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/interpreter/interpreter.h" 5 #include "src/interpreter/interpreter.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/codegen.h" 10 #include "src/codegen.h"
11 #include "src/compilation-info.h" 11 #include "src/compilation-info.h"
12 #include "src/compiler.h" 12 #include "src/compiler.h"
13 #include "src/counters.h" 13 #include "src/counters.h"
14 #include "src/interpreter/bytecode-generator.h" 14 #include "src/interpreter/bytecode-generator.h"
15 #include "src/interpreter/bytecodes.h" 15 #include "src/interpreter/bytecodes.h"
16 #include "src/log.h" 16 #include "src/log.h"
17 #include "src/objects.h" 17 #include "src/objects.h"
18 #include "src/setup-isolate.h" 18 #include "src/setup-isolate.h"
19 #include "src/visitors.h"
19 20
20 namespace v8 { 21 namespace v8 {
21 namespace internal { 22 namespace internal {
22 namespace interpreter { 23 namespace interpreter {
23 24
24 class InterpreterCompilationJob final : public CompilationJob { 25 class InterpreterCompilationJob final : public CompilationJob {
25 public: 26 public:
26 explicit InterpreterCompilationJob(CompilationInfo* info); 27 explicit InterpreterCompilationJob(CompilationInfo* info);
27 28
28 protected: 29 protected:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 return index; 103 return index;
103 case OperandScale::kDouble: 104 case OperandScale::kDouble:
104 return index + kEntriesPerOperandScale; 105 return index + kEntriesPerOperandScale;
105 case OperandScale::kQuadruple: 106 case OperandScale::kQuadruple:
106 return index + 2 * kEntriesPerOperandScale; 107 return index + 2 * kEntriesPerOperandScale;
107 } 108 }
108 UNREACHABLE(); 109 UNREACHABLE();
109 return 0; 110 return 0;
110 } 111 }
111 112
112 void Interpreter::IterateDispatchTable(ObjectVisitor* v) { 113 void Interpreter::IterateDispatchTable(RootVisitor* v) {
113 for (int i = 0; i < kDispatchTableSize; i++) { 114 for (int i = 0; i < kDispatchTableSize; i++) {
114 Address code_entry = dispatch_table_[i]; 115 Address code_entry = dispatch_table_[i];
115 Object* code = code_entry == nullptr 116 Object* code = code_entry == nullptr
116 ? nullptr 117 ? nullptr
117 : Code::GetCodeFromTargetAddress(code_entry); 118 : Code::GetCodeFromTargetAddress(code_entry);
118 Object* old_code = code; 119 Object* old_code = code;
119 v->VisitPointer(&code); 120 v->VisitRootPointer(Root::kDispatchTable, &code);
120 if (code != old_code) { 121 if (code != old_code) {
121 dispatch_table_[i] = reinterpret_cast<Code*>(code)->entry(); 122 dispatch_table_[i] = reinterpret_cast<Code*>(code)->entry();
122 } 123 }
123 } 124 }
124 } 125 }
125 126
126 // static 127 // static
127 int Interpreter::InterruptBudget() { 128 int Interpreter::InterruptBudget() {
128 return FLAG_interrupt_budget * kCodeSizeMultiplier; 129 return FLAG_interrupt_budget * kCodeSizeMultiplier;
129 } 130 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 counters_map->DefineOwnProperty(context, from_name_object, counters_row) 284 counters_map->DefineOwnProperty(context, from_name_object, counters_row)
284 .IsJust()); 285 .IsJust());
285 } 286 }
286 287
287 return counters_map; 288 return counters_map;
288 } 289 }
289 290
290 } // namespace interpreter 291 } // namespace interpreter
291 } // namespace internal 292 } // namespace internal
292 } // namespace v8 293 } // namespace v8
OLDNEW
« no previous file with comments | « src/interpreter/interpreter.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698