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

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

Issue 1254293006: [interpreter] Change interpreter to use an BytecodeArray pointer and and offset. (Closed) Base URL: ssh://rmcilroy.lon.corp.google.com///usr/local/google/code/v8_full/v8@master
Patch Set: Fix MIPS merge error Created 5 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 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 "src/compiler.h" 7 #include "src/compiler.h"
8 #include "src/compiler/interpreter-assembler.h" 8 #include "src/compiler/interpreter-assembler.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/interpreter/bytecodes.h" 10 #include "src/interpreter/bytecodes.h"
(...skipping 10 matching lines...) Expand all
21 Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) {} 21 Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) {}
22 22
23 23
24 void Interpreter::Initialize(bool create_heap_objects) { 24 void Interpreter::Initialize(bool create_heap_objects) {
25 DCHECK(FLAG_ignition); 25 DCHECK(FLAG_ignition);
26 if (create_heap_objects) { 26 if (create_heap_objects) {
27 Zone zone; 27 Zone zone;
28 HandleScope scope(isolate_); 28 HandleScope scope(isolate_);
29 Handle<FixedArray> handler_table = isolate_->factory()->NewFixedArray( 29 Handle<FixedArray> handler_table = isolate_->factory()->NewFixedArray(
30 static_cast<int>(Bytecode::kLast) + 1, TENURED); 30 static_cast<int>(Bytecode::kLast) + 1, TENURED);
31 // We rely on the interpreter handler table being immovable, so check that
32 // it was allocated on the first page (which is always immovable).
33 DCHECK(isolate_->heap()->old_space()->FirstPage()->Contains(
34 handler_table->address()));
31 isolate_->heap()->public_set_interpreter_table(*handler_table); 35 isolate_->heap()->public_set_interpreter_table(*handler_table);
32 36
33 #define GENERATE_CODE(Name, _) \ 37 #define GENERATE_CODE(Name, _) \
34 { \ 38 { \
35 compiler::InterpreterAssembler assembler(isolate_, &zone, \ 39 compiler::InterpreterAssembler assembler(isolate_, &zone, \
36 Bytecode::k##Name); \ 40 Bytecode::k##Name); \
37 Do##Name(&assembler); \ 41 Do##Name(&assembler); \
38 Handle<Code> code = assembler.GenerateCode(); \ 42 Handle<Code> code = assembler.GenerateCode(); \
39 handler_table->set(static_cast<int>(Bytecode::k##Name), *code); \ 43 handler_table->set(static_cast<int>(Bytecode::k##Name), *code); \
40 } 44 }
(...skipping 14 matching lines...) Expand all
55 59
56 // Return the value in register 0. 60 // Return the value in register 0.
57 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { 61 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
58 // TODO(rmcilroy) Jump to exit trampoline. 62 // TODO(rmcilroy) Jump to exit trampoline.
59 } 63 }
60 64
61 65
62 } // namespace interpreter 66 } // namespace interpreter
63 } // namespace internal 67 } // namespace internal
64 } // namespace v8 68 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/linkage-x64.cc ('k') | test/unittests/compiler/interpreter-assembler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698