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/bytecode-array-builder.h" | 5 #include "src/interpreter/bytecode-array-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/interpreter/bytecode-array-writer.h" | 8 #include "src/interpreter/bytecode-array-writer.h" |
9 #include "src/interpreter/bytecode-dead-code-optimizer.h" | 9 #include "src/interpreter/bytecode-dead-code-optimizer.h" |
10 #include "src/interpreter/bytecode-label.h" | 10 #include "src/interpreter/bytecode-label.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 return *this; | 231 return *this; |
232 } | 232 } |
233 | 233 |
234 BytecodeArrayBuilder& BytecodeArrayBuilder::MoveRegister(Register from, | 234 BytecodeArrayBuilder& BytecodeArrayBuilder::MoveRegister(Register from, |
235 Register to) { | 235 Register to) { |
236 DCHECK(from != to); | 236 DCHECK(from != to); |
237 Output(Bytecode::kMov, RegisterOperand(from), RegisterOperand(to)); | 237 Output(Bytecode::kMov, RegisterOperand(from), RegisterOperand(to)); |
238 return *this; | 238 return *this; |
239 } | 239 } |
240 | 240 |
241 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal( | 241 BytecodeArrayBuilder& BytecodeArrayBuilder::LoadGlobal(int feedback_slot, |
242 const Handle<String> name, int feedback_slot, TypeofMode typeof_mode) { | 242 TypeofMode typeof_mode) { |
243 // TODO(rmcilroy): Potentially store typeof information in an | 243 // TODO(rmcilroy): Potentially store typeof information in an |
244 // operand rather than having extra bytecodes. | 244 // operand rather than having extra bytecodes. |
245 Bytecode bytecode = BytecodeForLoadGlobal(typeof_mode); | 245 Bytecode bytecode = BytecodeForLoadGlobal(typeof_mode); |
246 size_t name_index = GetConstantPoolEntry(name); | 246 Output(bytecode, UnsignedOperand(feedback_slot)); |
247 Output(bytecode, UnsignedOperand(name_index), UnsignedOperand(feedback_slot)); | |
248 return *this; | 247 return *this; |
249 } | 248 } |
250 | 249 |
251 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal( | 250 BytecodeArrayBuilder& BytecodeArrayBuilder::StoreGlobal( |
252 const Handle<String> name, int feedback_slot, LanguageMode language_mode) { | 251 const Handle<String> name, int feedback_slot, LanguageMode language_mode) { |
253 Bytecode bytecode = BytecodeForStoreGlobal(language_mode); | 252 Bytecode bytecode = BytecodeForStoreGlobal(language_mode); |
254 size_t name_index = GetConstantPoolEntry(name); | 253 size_t name_index = GetConstantPoolEntry(name); |
255 Output(bytecode, UnsignedOperand(name_index), UnsignedOperand(feedback_slot)); | 254 Output(bytecode, UnsignedOperand(name_index), UnsignedOperand(feedback_slot)); |
256 return *this; | 255 return *this; |
257 } | 256 } |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 return Bytecode::kTailCall; | 930 return Bytecode::kTailCall; |
932 default: | 931 default: |
933 UNREACHABLE(); | 932 UNREACHABLE(); |
934 } | 933 } |
935 return Bytecode::kIllegal; | 934 return Bytecode::kIllegal; |
936 } | 935 } |
937 | 936 |
938 } // namespace interpreter | 937 } // namespace interpreter |
939 } // namespace internal | 938 } // namespace internal |
940 } // namespace v8 | 939 } // namespace v8 |
OLD | NEW |