Chromium Code Reviews| 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 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
| 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/interpreter/bytecode-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
| 10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 // be in |receiver_args| and all subsequent arguments should be in registers | 210 // be in |receiver_args| and all subsequent arguments should be in registers |
| 211 // <receiver + 1> to <receiver + receiver_args_count - 1>. | 211 // <receiver + 1> to <receiver + receiver_args_count - 1>. |
| 212 BytecodeArrayBuilder& CallJSRuntime(int context_index, Register receiver_args, | 212 BytecodeArrayBuilder& CallJSRuntime(int context_index, Register receiver_args, |
| 213 size_t receiver_args_count); | 213 size_t receiver_args_count); |
| 214 | 214 |
| 215 // Operators (register holds the lhs value, accumulator holds the rhs value). | 215 // Operators (register holds the lhs value, accumulator holds the rhs value). |
| 216 // Type feedback will be recorded in the |feedback_slot| | 216 // Type feedback will be recorded in the |feedback_slot| |
| 217 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, | 217 BytecodeArrayBuilder& BinaryOperation(Token::Value binop, Register reg, |
| 218 int feedback_slot); | 218 int feedback_slot); |
| 219 | 219 |
| 220 // Operators (register holds the lhs value, accumulator holds the rhs value). | |
| 221 // Type feedback will be recorded in the |feedback_slot| | |
| 222 BytecodeArrayBuilder& BinaryOperationSmi(Token::Value binop, | |
|
rmcilroy
2016/08/23 13:31:17
Please don't add this as a specific operation, it
epertoso
2016/08/23 14:22:16
Done.
| |
| 223 int32_t smi_value, Register reg, | |
| 224 int feedback_slot); | |
| 225 | |
| 220 // Count Operators (value stored in accumulator). | 226 // Count Operators (value stored in accumulator). |
| 221 // Type feedback will be recorded in the |feedback_slot| | 227 // Type feedback will be recorded in the |feedback_slot| |
| 222 BytecodeArrayBuilder& CountOperation(Token::Value op, int feedback_slot); | 228 BytecodeArrayBuilder& CountOperation(Token::Value op, int feedback_slot); |
| 223 | 229 |
| 224 // Unary Operators. | 230 // Unary Operators. |
| 225 BytecodeArrayBuilder& LogicalNot(); | 231 BytecodeArrayBuilder& LogicalNot(); |
| 226 BytecodeArrayBuilder& TypeOf(); | 232 BytecodeArrayBuilder& TypeOf(); |
| 227 | 233 |
| 228 // Deletes property from an object. This expects that accumulator contains | 234 // Deletes property from an object. This expects that accumulator contains |
| 229 // the key to be deleted and the register contains a reference to the object. | 235 // the key to be deleted and the register contains a reference to the object. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 | 328 |
| 323 static uint32_t UnsignedOperand(size_t value) { | 329 static uint32_t UnsignedOperand(size_t value) { |
| 324 DCHECK_LE(value, kMaxUInt32); | 330 DCHECK_LE(value, kMaxUInt32); |
| 325 return static_cast<uint32_t>(value); | 331 return static_cast<uint32_t>(value); |
| 326 } | 332 } |
| 327 | 333 |
| 328 private: | 334 private: |
| 329 friend class BytecodeRegisterAllocator; | 335 friend class BytecodeRegisterAllocator; |
| 330 | 336 |
| 331 static Bytecode BytecodeForBinaryOperation(Token::Value op); | 337 static Bytecode BytecodeForBinaryOperation(Token::Value op); |
| 338 static Bytecode BytecodeForBinaryOperationSmi(Token::Value op); | |
| 332 static Bytecode BytecodeForCountOperation(Token::Value op); | 339 static Bytecode BytecodeForCountOperation(Token::Value op); |
| 333 static Bytecode BytecodeForCompareOperation(Token::Value op); | 340 static Bytecode BytecodeForCompareOperation(Token::Value op); |
| 334 static Bytecode BytecodeForStoreNamedProperty(LanguageMode language_mode); | 341 static Bytecode BytecodeForStoreNamedProperty(LanguageMode language_mode); |
| 335 static Bytecode BytecodeForStoreKeyedProperty(LanguageMode language_mode); | 342 static Bytecode BytecodeForStoreKeyedProperty(LanguageMode language_mode); |
| 336 static Bytecode BytecodeForLoadGlobal(TypeofMode typeof_mode); | 343 static Bytecode BytecodeForLoadGlobal(TypeofMode typeof_mode); |
| 337 static Bytecode BytecodeForStoreGlobal(LanguageMode language_mode); | 344 static Bytecode BytecodeForStoreGlobal(LanguageMode language_mode); |
| 338 static Bytecode BytecodeForStoreLookupSlot(LanguageMode language_mode); | 345 static Bytecode BytecodeForStoreLookupSlot(LanguageMode language_mode); |
| 339 static Bytecode BytecodeForCreateArguments(CreateArgumentsType type); | 346 static Bytecode BytecodeForCreateArguments(CreateArgumentsType type); |
| 340 static Bytecode BytecodeForDelete(LanguageMode language_mode); | 347 static Bytecode BytecodeForDelete(LanguageMode language_mode); |
| 341 static Bytecode BytecodeForCall(TailCallMode tail_call_mode); | 348 static Bytecode BytecodeForCall(TailCallMode tail_call_mode); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 BytecodeSourceInfo latest_source_info_; | 408 BytecodeSourceInfo latest_source_info_; |
| 402 | 409 |
| 403 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 410 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
| 404 }; | 411 }; |
| 405 | 412 |
| 406 } // namespace interpreter | 413 } // namespace interpreter |
| 407 } // namespace internal | 414 } // namespace internal |
| 408 } // namespace v8 | 415 } // namespace v8 |
| 409 | 416 |
| 410 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 417 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
| OLD | NEW |