OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 // or returns the {value} converted to a String otherwise. | 460 // or returns the {value} converted to a String otherwise. |
461 compiler::Node* ToThisString(compiler::Node* context, compiler::Node* value, | 461 compiler::Node* ToThisString(compiler::Node* context, compiler::Node* value, |
462 char const* method_name); | 462 char const* method_name); |
463 // Throws a TypeError for {method_name} if {value} is neither of the given | 463 // Throws a TypeError for {method_name} if {value} is neither of the given |
464 // {primitive_type} nor a JSValue wrapping a value of {primitive_type}, or | 464 // {primitive_type} nor a JSValue wrapping a value of {primitive_type}, or |
465 // returns the {value} (or wrapped value) otherwise. | 465 // returns the {value} (or wrapped value) otherwise. |
466 compiler::Node* ToThisValue(compiler::Node* context, compiler::Node* value, | 466 compiler::Node* ToThisValue(compiler::Node* context, compiler::Node* value, |
467 PrimitiveType primitive_type, | 467 PrimitiveType primitive_type, |
468 char const* method_name); | 468 char const* method_name); |
469 | 469 |
| 470 // Throws a TypeError for {method_name} if {value} is not of the given |
| 471 // instance type. Returns {value}'s map. |
| 472 compiler::Node* ThrowIfNotInstanceType(compiler::Node* context, |
| 473 compiler::Node* value, |
| 474 InstanceType instance_type, |
| 475 char const* method_name); |
| 476 |
470 // String helpers. | 477 // String helpers. |
471 // Load a character from a String (might flatten a ConsString). | 478 // Load a character from a String (might flatten a ConsString). |
472 compiler::Node* StringCharCodeAt(compiler::Node* string, | 479 compiler::Node* StringCharCodeAt(compiler::Node* string, |
473 compiler::Node* smi_index); | 480 compiler::Node* smi_index); |
474 // Return the single character string with only {code}. | 481 // Return the single character string with only {code}. |
475 compiler::Node* StringFromCharCode(compiler::Node* code); | 482 compiler::Node* StringFromCharCode(compiler::Node* code); |
476 // Return a new string object which holds a substring containing the range | 483 // Return a new string object which holds a substring containing the range |
477 // [from,to[ of string. |from| and |to| are expected to be tagged. | 484 // [from,to[ of string. |from| and |to| are expected to be tagged. |
478 compiler::Node* SubString(compiler::Node* context, compiler::Node* string, | 485 compiler::Node* SubString(compiler::Node* context, compiler::Node* string, |
479 compiler::Node* from, compiler::Node* to); | 486 compiler::Node* from, compiler::Node* to); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 Label* bailout); | 870 Label* bailout); |
864 | 871 |
865 static const int kElementLoopUnrollThreshold = 8; | 872 static const int kElementLoopUnrollThreshold = 8; |
866 }; | 873 }; |
867 | 874 |
868 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 875 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
869 | 876 |
870 } // namespace internal | 877 } // namespace internal |
871 } // namespace v8 | 878 } // namespace v8 |
872 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 879 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |