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

Side by Side Diff: src/interpreter/setup-interpreter-internal.cc

Issue 2912063002: Revert of [arm] Share constant pool entries in snapshot. (Closed)
Patch Set: Created 3 years, 6 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/heap/heap.cc ('k') | tools/v8heapconst.py » ('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 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 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/setup-interpreter.h" 5 #include "src/interpreter/setup-interpreter.h"
6 6
7 #include "src/handles-inl.h" 7 #include "src/handles-inl.h"
8 #include "src/interpreter/bytecodes.h" 8 #include "src/interpreter/bytecodes.h"
9 #include "src/interpreter/interpreter-generator.h" 9 #include "src/interpreter/interpreter-generator.h"
10 #include "src/interpreter/interpreter.h" 10 #include "src/interpreter/interpreter.h"
11 #include "src/objects-inl.h" 11 #include "src/objects-inl.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace internal { 14 namespace internal {
15 namespace interpreter { 15 namespace interpreter {
16 16
17 // static 17 // static
18 void SetupInterpreter::InstallBytecodeHandlers(Interpreter* interpreter) { 18 void SetupInterpreter::InstallBytecodeHandlers(Interpreter* interpreter) {
19 DCHECK(!interpreter->IsDispatchTableInitialized()); 19 DCHECK(!interpreter->IsDispatchTableInitialized());
20 HandleScope scope(interpreter->isolate_); 20 HandleScope scope(interpreter->isolate_);
21 // Canonicalize handles, so that we can share constant pool entries pointing
22 // to code targets without dereferencing their handles.
23 CanonicalHandleScope canonical(interpreter->isolate_);
24 Address* dispatch_table = interpreter->dispatch_table_; 21 Address* dispatch_table = interpreter->dispatch_table_;
25 22
26 // Generate bytecode handlers for all bytecodes and scales. 23 // Generate bytecode handlers for all bytecodes and scales.
27 const OperandScale kOperandScales[] = { 24 const OperandScale kOperandScales[] = {
28 #define VALUE(Name, _) OperandScale::k##Name, 25 #define VALUE(Name, _) OperandScale::k##Name,
29 OPERAND_SCALE_LIST(VALUE) 26 OPERAND_SCALE_LIST(VALUE)
30 #undef VALUE 27 #undef VALUE
31 }; 28 };
32 29
33 for (OperandScale operand_scale : kOperandScales) { 30 for (OperandScale operand_scale : kOperandScales) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (ReuseExistingHandler(dispatch_table, bytecode, operand_scale)) return; 82 if (ReuseExistingHandler(dispatch_table, bytecode, operand_scale)) return;
86 83
87 size_t index = Interpreter::GetDispatchTableIndex(bytecode, operand_scale); 84 size_t index = Interpreter::GetDispatchTableIndex(bytecode, operand_scale);
88 Handle<Code> code = GenerateBytecodeHandler(isolate, bytecode, operand_scale); 85 Handle<Code> code = GenerateBytecodeHandler(isolate, bytecode, operand_scale);
89 dispatch_table[index] = code->entry(); 86 dispatch_table[index] = code->entry();
90 } 87 }
91 88
92 } // namespace interpreter 89 } // namespace interpreter
93 } // namespace internal 90 } // namespace internal
94 } // namespace v8 91 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | tools/v8heapconst.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698