OLD | NEW |
---|---|
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 30 matching lines...) Expand all Loading... | |
41 Do##Name(&assembler); \ | 41 Do##Name(&assembler); \ |
42 Handle<Code> code = assembler.GenerateCode(); \ | 42 Handle<Code> code = assembler.GenerateCode(); \ |
43 handler_table->set(static_cast<int>(Bytecode::k##Name), *code); \ | 43 handler_table->set(static_cast<int>(Bytecode::k##Name), *code); \ |
44 } | 44 } |
45 BYTECODE_LIST(GENERATE_CODE) | 45 BYTECODE_LIST(GENERATE_CODE) |
46 #undef GENERATE_CODE | 46 #undef GENERATE_CODE |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 | 50 |
51 // LoadLiteral0 <dst> | 51 // LdaZero <dst> |
rmcilroy
2015/07/31 09:56:19
Remove <dst>
oth
2015/07/31 11:20:59
Done.
| |
52 // | 52 // |
53 // Load literal '0' into the destination register. | 53 // Load literal '0' into the destination register. |
rmcilroy
2015/07/31 09:56:19
update comment /s/destination/accumulator/ and rem
oth
2015/07/31 11:20:59
Done.
| |
54 void Interpreter::DoLoadLiteral0(compiler::InterpreterAssembler* assembler) { | 54 void Interpreter::DoLdaZero(compiler::InterpreterAssembler* assembler) { |
55 Node* register_index = __ BytecodeOperand(0); | 55 Node* register_index = __ BytecodeOperand(0); |
56 __ StoreRegister(__ NumberConstant(0), register_index); | 56 __ StoreRegister(__ NumberConstant(0), register_index); |
57 __ Dispatch(); | 57 __ Dispatch(); |
58 } | 58 } |
59 | 59 |
60 | 60 |
61 // LoadSmi8 <dst>, <imm8> | 61 // LdaSmi8 <dst>, <imm8> |
rmcilroy
2015/07/31 09:56:19
remove <dst>
oth
2015/07/31 11:20:59
Done.
| |
62 // | 62 // |
63 // Load an 8-bit integer literal into destination register as a Smi. | 63 // Load an 8-bit integer literal into destination register as a Smi. |
rmcilroy
2015/07/31 09:56:19
/s/destination/acumulator
oth
2015/07/31 11:20:59
Done.
| |
64 void Interpreter::DoLoadSmi8(compiler::InterpreterAssembler* assembler) { | 64 void Interpreter::DoLdaSmi8(compiler::InterpreterAssembler* assembler) { |
65 // TODO(rmcilroy) Convert an 8-bit integer to a Smi. | 65 // TODO(rmcilroy) Implement 8-bit integer to SMI promotion. |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 // LdaUndefined | |
70 // | |
71 // Load Undefined into the accumulator. | |
72 void Interpreter::DoLdaUndefined(compiler::InterpreterAssembler* assembler) { | |
73 // TODO(rmcilroy) Implement. | |
74 } | |
75 | |
76 | |
77 // LdaNull | |
78 // | |
79 // Load Null into the accumulator. | |
80 void Interpreter::DoLdaNull(compiler::InterpreterAssembler* assembler) { | |
81 // TODO(rmcilroy) Implement. | |
82 } | |
83 | |
84 | |
85 // LdaTheHole | |
86 // | |
87 // Load TheHole into the accumulator. | |
88 void Interpreter::DoLdaTheHole(compiler::InterpreterAssembler* assembler) { | |
89 // TODO(rmcilroy) Implement. | |
90 } | |
91 | |
92 | |
93 // LdaTrue | |
94 // | |
95 // Load True into the accumulator. | |
96 void Interpreter::DoLdaTrue(compiler::InterpreterAssembler* assembler) { | |
97 // TODO(rmcilroy) Implement. | |
98 } | |
99 | |
100 | |
101 // LdaFalse | |
102 // | |
103 // Load False into the accumulator. | |
104 void Interpreter::DoLdaFalse(compiler::InterpreterAssembler* assembler) { | |
105 // TODO(rmcilroy) Implement. | |
106 } | |
107 | |
108 | |
109 // Ldar <src> | |
110 // | |
111 // Load accumulator with value from register <src>. | |
112 void Interpreter::DoLdar(compiler::InterpreterAssembler* assembler) { | |
113 // TODO(rmcilroy) Implement. | |
114 } | |
115 | |
116 | |
117 // Star <dst> | |
118 // | |
119 // Store accumulator to register <dst>. | |
120 void Interpreter::DoStar(compiler::InterpreterAssembler* assembler) { | |
121 // TODO(rmcilroy) Implement. | |
122 } | |
123 | |
124 | |
125 // Add <src> | |
126 // | |
127 // Add register <src> to accumulator. | |
128 void Interpreter::DoAdd(compiler::InterpreterAssembler* assembler) { | |
129 // TODO(rmcilroy) Implement. | |
130 } | |
131 | |
132 | |
133 // Sub <src> | |
134 // | |
135 // Subtract register <src> from accumulator. | |
136 void Interpreter::DoSub(compiler::InterpreterAssembler* assembler) { | |
137 // TODO(rmcilroy) Implement. | |
138 } | |
139 | |
140 | |
141 // Mul <src> | |
142 // | |
143 // Multiply accumulator by register <src>. | |
144 void Interpreter::DoMul(compiler::InterpreterAssembler* assembler) { | |
145 // TODO(rmcilroy) Implement add register to accumulator. | |
146 } | |
147 | |
148 | |
149 // Div <src> | |
150 // | |
151 // Divide register <src> by accumulator. | |
152 void Interpreter::DoDiv(compiler::InterpreterAssembler* assembler) { | |
153 // TODO(rmcilroy) Implement. | |
154 } | |
155 | |
156 | |
69 // Return | 157 // Return |
70 // | 158 // |
71 // Return the value in register 0. | 159 // Return the value in register 0. |
72 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 160 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
73 __ Return(); | 161 __ Return(); |
74 } | 162 } |
75 | 163 |
76 | 164 |
77 } // namespace interpreter | 165 } // namespace interpreter |
78 } // namespace internal | 166 } // namespace internal |
79 } // namespace v8 | 167 } // namespace v8 |
OLD | NEW |