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

Side by Side Diff: src/compiler/interpreter-assembler.h

Issue 1294133004: [Interpreter] Pass context to interpreter bytecode handlers and add LoadConstextSlot (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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
« no previous file with comments | « no previous file | src/compiler/interpreter-assembler.cc » ('j') | src/compiler/linkage.cc » ('J')
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 #ifndef V8_COMPILER_INTERPRETER_ASSEMBLER_H_ 5 #ifndef V8_COMPILER_INTERPRETER_ASSEMBLER_H_
6 #define V8_COMPILER_INTERPRETER_ASSEMBLER_H_ 6 #define V8_COMPILER_INTERPRETER_ASSEMBLER_H_
7 7
8 // Clients of this interface shouldn't depend on lots of compiler internals. 8 // Clients of this interface shouldn't depend on lots of compiler internals.
9 // Do not include anything from src/compiler here! 9 // Do not include anything from src/compiler here!
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // Accumulator. 46 // Accumulator.
47 Node* GetAccumulator(); 47 Node* GetAccumulator();
48 void SetAccumulator(Node* value); 48 void SetAccumulator(Node* value);
49 49
50 // Loads from and stores to the interpreter register file. 50 // Loads from and stores to the interpreter register file.
51 Node* LoadRegister(Node* reg_index); 51 Node* LoadRegister(Node* reg_index);
52 Node* StoreRegister(Node* value, Node* reg_index); 52 Node* StoreRegister(Node* value, Node* reg_index);
53 53
54 // Constants. 54 // Constants.
55 Node* Int32Constant(int value); 55 Node* Int32Constant(int value);
56 Node* IntPtrConstant(intptr_t value);
56 Node* NumberConstant(double value); 57 Node* NumberConstant(double value);
57 Node* HeapConstant(Unique<HeapObject> object); 58 Node* HeapConstant(Unique<HeapObject> object);
58 59
59 // Tag and untag Smi values. 60 // Tag and untag Smi values.
60 Node* SmiTag(Node* value); 61 Node* SmiTag(Node* value);
61 Node* SmiUntag(Node* value); 62 Node* SmiUntag(Node* value);
62 63
64 // Load |slot_index| from the current context.
65 Node* LoadContextSlot(int slot_index);
66
63 // Returns from the function. 67 // Returns from the function.
64 void Return(); 68 void Return();
65 69
66 // Dispatch to the bytecode. 70 // Dispatch to the bytecode.
67 void Dispatch(); 71 void Dispatch();
68 72
69 protected: 73 protected:
70 // Close the graph. 74 // Close the graph.
71 void End(); 75 void End();
72 76
73 // Protected helpers (for testing) which delegate to RawMachineAssembler. 77 // Protected helpers (for testing) which delegate to RawMachineAssembler.
74 CallDescriptor* call_descriptor() const; 78 CallDescriptor* call_descriptor() const;
75 Graph* graph(); 79 Graph* graph();
76 80
77 private: 81 private:
78 // Returns a raw pointer to start of the register file on the stack. 82 // Returns a raw pointer to start of the register file on the stack.
79 Node* RegisterFileRawPointer(); 83 Node* RegisterFileRawPointer();
80 // Returns a tagged pointer to the current function's BytecodeArray object. 84 // Returns a tagged pointer to the current function's BytecodeArray object.
81 Node* BytecodeArrayTaggedPointer(); 85 Node* BytecodeArrayTaggedPointer();
82 // Returns the offset from the BytecodeArrayPointer of the current bytecode. 86 // Returns the offset from the BytecodeArrayPointer of the current bytecode.
83 Node* BytecodeOffset(); 87 Node* BytecodeOffset();
84 // Returns a pointer to first entry in the interpreter dispatch table. 88 // Returns a raw pointer to first entry in the interpreter dispatch table.
85 Node* DispatchTableRawPointer(); 89 Node* DispatchTableRawPointer();
90 // Returns a tagged pointer to the current context.
91 Node* ContextTaggedPointer();
86 92
87 // Returns the offset of register |index| relative to RegisterFilePointer(). 93 // Returns the offset of register |index| relative to RegisterFilePointer().
88 Node* RegisterFrameOffset(Node* index); 94 Node* RegisterFrameOffset(Node* index);
89 95
90 Node* SmiShiftBitsConstant(); 96 Node* SmiShiftBitsConstant();
91 Node* BytecodeOperand(int operand_index); 97 Node* BytecodeOperand(int operand_index);
92 Node* BytecodeOperandSignExtended(int operand_index); 98 Node* BytecodeOperandSignExtended(int operand_index);
93 99
94 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not 100 // Returns BytecodeOffset() advanced by delta bytecodes. Note: this does not
95 // update BytecodeOffset() itself. 101 // update BytecodeOffset() itself.
(...skipping 13 matching lines...) Expand all
109 bool code_generated_; 115 bool code_generated_;
110 116
111 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler); 117 DISALLOW_COPY_AND_ASSIGN(InterpreterAssembler);
112 }; 118 };
113 119
114 } // namespace interpreter 120 } // namespace interpreter
115 } // namespace internal 121 } // namespace internal
116 } // namespace v8 122 } // namespace v8
117 123
118 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_ 124 #endif // V8_COMPILER_INTERPRETER_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/interpreter-assembler.cc » ('j') | src/compiler/linkage.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698