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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 // |length| and |offset| are expected to be tagged. | 353 // |length| and |offset| are expected to be tagged. |
354 compiler::Node* AllocateSlicedOneByteString(compiler::Node* length, | 354 compiler::Node* AllocateSlicedOneByteString(compiler::Node* length, |
355 compiler::Node* parent, | 355 compiler::Node* parent, |
356 compiler::Node* offset); | 356 compiler::Node* offset); |
357 // Allocate a SlicedTwoByteString with the given length, parent and offset. | 357 // Allocate a SlicedTwoByteString with the given length, parent and offset. |
358 // |length| and |offset| are expected to be tagged. | 358 // |length| and |offset| are expected to be tagged. |
359 compiler::Node* AllocateSlicedTwoByteString(compiler::Node* length, | 359 compiler::Node* AllocateSlicedTwoByteString(compiler::Node* length, |
360 compiler::Node* parent, | 360 compiler::Node* parent, |
361 compiler::Node* offset); | 361 compiler::Node* offset); |
362 | 362 |
| 363 // Allocate a one-byte ConsString with the given length, first and second |
| 364 // parts. |length| is expected to be tagged, and |first| and |second| are |
| 365 // expected to be one-byte strings. |
| 366 compiler::Node* AllocateOneByteConsString(compiler::Node* length, |
| 367 compiler::Node* first, |
| 368 compiler::Node* second); |
| 369 // Allocate a two-byte ConsString with the given length, first and second |
| 370 // parts. |length| is expected to be tagged, and |first| and |second| are |
| 371 // expected to be two-byte strings. |
| 372 compiler::Node* AllocateTwoByteConsString(compiler::Node* length, |
| 373 compiler::Node* first, |
| 374 compiler::Node* second); |
| 375 |
363 // Allocate a RegExpResult with the given length (the number of captures, | 376 // Allocate a RegExpResult with the given length (the number of captures, |
364 // including the match itself), index (the index where the match starts), | 377 // including the match itself), index (the index where the match starts), |
365 // and input string. |length| and |index| are expected to be tagged, and | 378 // and input string. |length| and |index| are expected to be tagged, and |
366 // |input| must be a string. | 379 // |input| must be a string. |
367 compiler::Node* AllocateRegExpResult(compiler::Node* context, | 380 compiler::Node* AllocateRegExpResult(compiler::Node* context, |
368 compiler::Node* length, | 381 compiler::Node* length, |
369 compiler::Node* index, | 382 compiler::Node* index, |
370 compiler::Node* input); | 383 compiler::Node* input); |
371 | 384 |
372 // Allocate a JSArray without elements and initialize the header fields. | 385 // Allocate a JSArray without elements and initialize the header fields. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 // Copies |element_count| elements from |from_array| to |to_array| of | 426 // Copies |element_count| elements from |from_array| to |to_array| of |
414 // |capacity| size respecting both array's elements kinds. | 427 // |capacity| size respecting both array's elements kinds. |
415 void CopyFixedArrayElements( | 428 void CopyFixedArrayElements( |
416 ElementsKind from_kind, compiler::Node* from_array, ElementsKind to_kind, | 429 ElementsKind from_kind, compiler::Node* from_array, ElementsKind to_kind, |
417 compiler::Node* to_array, compiler::Node* element_count, | 430 compiler::Node* to_array, compiler::Node* element_count, |
418 compiler::Node* capacity, | 431 compiler::Node* capacity, |
419 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 432 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
420 ParameterMode mode = INTEGER_PARAMETERS); | 433 ParameterMode mode = INTEGER_PARAMETERS); |
421 | 434 |
422 // Copies |character_count| elements from |from_string| to |to_string| | 435 // Copies |character_count| elements from |from_string| to |to_string| |
423 // starting at the |from_index|'th character. |from_index| and | 436 // starting at the |from_index|'th character. |from_string| and |to_string| |
424 // |character_count| must be Smis s.t. | 437 // must be either both one-byte strings or both two-byte strings. |
425 // 0 <= |from_index| <= |from_index| + |character_count| < from_string.length. | 438 // |from_index|, |to_index| and |character_count| must be Smis s.t. |
| 439 // 0 <= |from_index| <= |from_index| + |character_count| <= from_string.length |
| 440 // and |
| 441 // 0 <= |to_index| <= |to_index| + |character_count| <= to_string.length. |
426 void CopyStringCharacters(compiler::Node* from_string, | 442 void CopyStringCharacters(compiler::Node* from_string, |
427 compiler::Node* to_string, | 443 compiler::Node* to_string, |
428 compiler::Node* from_index, | 444 compiler::Node* from_index, |
| 445 compiler::Node* to_index, |
429 compiler::Node* character_count, | 446 compiler::Node* character_count, |
430 String::Encoding encoding); | 447 String::Encoding encoding); |
431 | 448 |
432 // Loads an element from |array| of |from_kind| elements by given |offset| | 449 // Loads an element from |array| of |from_kind| elements by given |offset| |
433 // (NOTE: not index!), does a hole check if |if_hole| is provided and | 450 // (NOTE: not index!), does a hole check if |if_hole| is provided and |
434 // converts the value so that it becomes ready for storing to array of | 451 // converts the value so that it becomes ready for storing to array of |
435 // |to_kind| elements. | 452 // |to_kind| elements. |
436 compiler::Node* LoadElementAndPrepareForStore(compiler::Node* array, | 453 compiler::Node* LoadElementAndPrepareForStore(compiler::Node* array, |
437 compiler::Node* offset, | 454 compiler::Node* offset, |
438 ElementsKind from_kind, | 455 ElementsKind from_kind, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 // Load a character from a String (might flatten a ConsString). | 526 // Load a character from a String (might flatten a ConsString). |
510 compiler::Node* StringCharCodeAt(compiler::Node* string, | 527 compiler::Node* StringCharCodeAt(compiler::Node* string, |
511 compiler::Node* smi_index); | 528 compiler::Node* smi_index); |
512 // Return the single character string with only {code}. | 529 // Return the single character string with only {code}. |
513 compiler::Node* StringFromCharCode(compiler::Node* code); | 530 compiler::Node* StringFromCharCode(compiler::Node* code); |
514 // Return a new string object which holds a substring containing the range | 531 // Return a new string object which holds a substring containing the range |
515 // [from,to[ of string. |from| and |to| are expected to be tagged. | 532 // [from,to[ of string. |from| and |to| are expected to be tagged. |
516 compiler::Node* SubString(compiler::Node* context, compiler::Node* string, | 533 compiler::Node* SubString(compiler::Node* context, compiler::Node* string, |
517 compiler::Node* from, compiler::Node* to); | 534 compiler::Node* from, compiler::Node* to); |
518 | 535 |
| 536 // Return a new string object produced by concatenating |first| with |second|. |
| 537 compiler::Node* StringConcat(compiler::Node* context, compiler::Node* first, |
| 538 compiler::Node* second); |
| 539 |
| 540 // Return the first index >= {from} at which {needle_char} was found in |
| 541 // {string}, or -1 if such an index does not exist. The returned value is |
| 542 // a Smi, {string} is expected to be a String, {needle_char} is an intptr, |
| 543 // and {from} is expected to be tagged. |
| 544 compiler::Node* StringIndexOfChar(compiler::Node* context, |
| 545 compiler::Node* string, |
| 546 compiler::Node* needle_char, |
| 547 compiler::Node* from); |
| 548 |
519 compiler::Node* StringFromCodePoint(compiler::Node* codepoint, | 549 compiler::Node* StringFromCodePoint(compiler::Node* codepoint, |
520 UnicodeEncoding encoding); | 550 UnicodeEncoding encoding); |
521 | 551 |
522 // Type conversion helpers. | 552 // Type conversion helpers. |
523 // Convert a String to a Number. | 553 // Convert a String to a Number. |
524 compiler::Node* StringToNumber(compiler::Node* context, | 554 compiler::Node* StringToNumber(compiler::Node* context, |
525 compiler::Node* input); | 555 compiler::Node* input); |
526 compiler::Node* NumberToString(compiler::Node* context, | 556 compiler::Node* NumberToString(compiler::Node* context, |
527 compiler::Node* input); | 557 compiler::Node* input); |
528 // Convert an object to a name. | 558 // Convert an object to a name. |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 Label* bailout); | 988 Label* bailout); |
959 | 989 |
960 static const int kElementLoopUnrollThreshold = 8; | 990 static const int kElementLoopUnrollThreshold = 8; |
961 }; | 991 }; |
962 | 992 |
963 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 993 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
964 | 994 |
965 } // namespace internal | 995 } // namespace internal |
966 } // namespace v8 | 996 } // namespace v8 |
967 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 997 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |