| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 enum AllocationFlag : uint8_t { | 58 enum AllocationFlag : uint8_t { |
| 59 kNone = 0, | 59 kNone = 0, |
| 60 kDoubleAlignment = 1, | 60 kDoubleAlignment = 1, |
| 61 kPretenured = 1 << 1, | 61 kPretenured = 1 << 1, |
| 62 kAllowLargeObjectAllocation = 1 << 2, | 62 kAllowLargeObjectAllocation = 1 << 2, |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 typedef base::Flags<AllocationFlag> AllocationFlags; | 65 typedef base::Flags<AllocationFlag> AllocationFlags; |
| 66 | 66 |
| 67 // TODO(ishell): Fix all loads/stores from arrays by int32 offsets/indices | 67 enum ParameterMode { SMI_PARAMETERS, INTPTR_PARAMETERS }; |
| 68 // and eventually remove INTEGER_PARAMETERS in favour of INTPTR_PARAMETERS. | |
| 69 enum ParameterMode { INTEGER_PARAMETERS, SMI_PARAMETERS, INTPTR_PARAMETERS }; | |
| 70 | 68 |
| 71 // On 32-bit platforms, there is a slight performance advantage to doing all | 69 // On 32-bit platforms, there is a slight performance advantage to doing all |
| 72 // of the array offset/index arithmetic with SMIs, since it's possible | 70 // of the array offset/index arithmetic with SMIs, since it's possible |
| 73 // to save a few tag/untag operations without paying an extra expense when | 71 // to save a few tag/untag operations without paying an extra expense when |
| 74 // calculating array offset (the smi math can be folded away) and there are | 72 // calculating array offset (the smi math can be folded away) and there are |
| 75 // fewer live ranges. Thus only convert indices to untagged value on 64-bit | 73 // fewer live ranges. Thus only convert indices to untagged value on 64-bit |
| 76 // platforms. | 74 // platforms. |
| 77 ParameterMode OptimalParameterMode() const { | 75 ParameterMode OptimalParameterMode() const { |
| 78 return Is64() ? INTPTR_PARAMETERS : SMI_PARAMETERS; | 76 return Is64() ? INTPTR_PARAMETERS : SMI_PARAMETERS; |
| 79 } | 77 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 97 Node* ParameterToTagged(Node* value, ParameterMode mode) { | 95 Node* ParameterToTagged(Node* value, ParameterMode mode) { |
| 98 if (mode != SMI_PARAMETERS) value = SmiTag(value); | 96 if (mode != SMI_PARAMETERS) value = SmiTag(value); |
| 99 return value; | 97 return value; |
| 100 } | 98 } |
| 101 | 99 |
| 102 Node* TaggedToParameter(Node* value, ParameterMode mode) { | 100 Node* TaggedToParameter(Node* value, ParameterMode mode) { |
| 103 if (mode != SMI_PARAMETERS) value = SmiUntag(value); | 101 if (mode != SMI_PARAMETERS) value = SmiUntag(value); |
| 104 return value; | 102 return value; |
| 105 } | 103 } |
| 106 | 104 |
| 107 #define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName, Int32OpName) \ | 105 #define PARAMETER_BINOP(OpName, IntPtrOpName, SmiOpName) \ |
| 108 Node* OpName(Node* a, Node* b, ParameterMode mode) { \ | 106 Node* OpName(Node* a, Node* b, ParameterMode mode) { \ |
| 109 if (mode == SMI_PARAMETERS) { \ | 107 if (mode == SMI_PARAMETERS) { \ |
| 110 return SmiOpName(a, b); \ | 108 return SmiOpName(a, b); \ |
| 111 } else if (mode == INTPTR_PARAMETERS) { \ | 109 } else { \ |
| 112 return IntPtrOpName(a, b); \ | 110 DCHECK_EQ(INTPTR_PARAMETERS, mode); \ |
| 113 } else { \ | 111 return IntPtrOpName(a, b); \ |
| 114 DCHECK_EQ(INTEGER_PARAMETERS, mode); \ | 112 } \ |
| 115 return Int32OpName(a, b); \ | |
| 116 } \ | |
| 117 } | 113 } |
| 118 PARAMETER_BINOP(IntPtrOrSmiAdd, IntPtrAdd, SmiAdd, Int32Add) | 114 PARAMETER_BINOP(IntPtrOrSmiAdd, IntPtrAdd, SmiAdd) |
| 119 PARAMETER_BINOP(IntPtrOrSmiLessThan, IntPtrLessThan, SmiLessThan, | 115 PARAMETER_BINOP(IntPtrOrSmiLessThan, IntPtrLessThan, SmiLessThan) |
| 120 Int32LessThan) | 116 PARAMETER_BINOP(IntPtrOrSmiGreaterThan, IntPtrGreaterThan, SmiGreaterThan) |
| 121 PARAMETER_BINOP(IntPtrOrSmiGreaterThan, IntPtrGreaterThan, SmiGreaterThan, | |
| 122 Int32GreaterThan) | |
| 123 PARAMETER_BINOP(IntPtrOrSmiGreaterThanOrEqual, IntPtrGreaterThanOrEqual, | 117 PARAMETER_BINOP(IntPtrOrSmiGreaterThanOrEqual, IntPtrGreaterThanOrEqual, |
| 124 SmiGreaterThanOrEqual, Int32GreaterThanOrEqual) | 118 SmiGreaterThanOrEqual) |
| 125 PARAMETER_BINOP(UintPtrOrSmiLessThan, UintPtrLessThan, SmiBelow, | 119 PARAMETER_BINOP(UintPtrOrSmiLessThan, UintPtrLessThan, SmiBelow) |
| 126 Uint32LessThan) | |
| 127 PARAMETER_BINOP(UintPtrOrSmiGreaterThanOrEqual, UintPtrGreaterThanOrEqual, | 120 PARAMETER_BINOP(UintPtrOrSmiGreaterThanOrEqual, UintPtrGreaterThanOrEqual, |
| 128 SmiAboveOrEqual, Uint32GreaterThanOrEqual) | 121 SmiAboveOrEqual) |
| 129 #undef PARAMETER_BINOP | 122 #undef PARAMETER_BINOP |
| 130 | 123 |
| 131 Node* NoContextConstant(); | 124 Node* NoContextConstant(); |
| 132 #define HEAP_CONSTANT_ACCESSOR(rootName, name) Node* name##Constant(); | 125 #define HEAP_CONSTANT_ACCESSOR(rootName, name) Node* name##Constant(); |
| 133 HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR) | 126 HEAP_CONSTANT_LIST(HEAP_CONSTANT_ACCESSOR) |
| 134 #undef HEAP_CONSTANT_ACCESSOR | 127 #undef HEAP_CONSTANT_ACCESSOR |
| 135 | 128 |
| 136 #define HEAP_CONSTANT_TEST(rootName, name) Node* Is##name(Node* value); | 129 #define HEAP_CONSTANT_TEST(rootName, name) Node* Is##name(Node* value); |
| 137 HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST) | 130 HEAP_CONSTANT_LIST(HEAP_CONSTANT_TEST) |
| 138 #undef HEAP_CONSTANT_TEST | 131 #undef HEAP_CONSTANT_TEST |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 | 358 |
| 366 // Load length field of a String object. | 359 // Load length field of a String object. |
| 367 Node* LoadStringLength(Node* object); | 360 Node* LoadStringLength(Node* object); |
| 368 // Load value field of a JSValue object. | 361 // Load value field of a JSValue object. |
| 369 Node* LoadJSValueValue(Node* object); | 362 Node* LoadJSValueValue(Node* object); |
| 370 // Load value field of a WeakCell object. | 363 // Load value field of a WeakCell object. |
| 371 Node* LoadWeakCellValueUnchecked(Node* weak_cell); | 364 Node* LoadWeakCellValueUnchecked(Node* weak_cell); |
| 372 Node* LoadWeakCellValue(Node* weak_cell, Label* if_cleared = nullptr); | 365 Node* LoadWeakCellValue(Node* weak_cell, Label* if_cleared = nullptr); |
| 373 | 366 |
| 374 // Load an array element from a FixedArray. | 367 // Load an array element from a FixedArray. |
| 375 Node* LoadFixedArrayElement( | 368 Node* LoadFixedArrayElement(Node* object, Node* index, |
| 376 Node* object, Node* index, int additional_offset = 0, | 369 int additional_offset = 0, |
| 377 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 370 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
| 378 Node* LoadFixedArrayElement(Node* object, int index, | 371 Node* LoadFixedArrayElement(Node* object, int index, |
| 379 int additional_offset = 0) { | 372 int additional_offset = 0) { |
| 380 return LoadFixedArrayElement(object, IntPtrConstant(index), | 373 return LoadFixedArrayElement(object, IntPtrConstant(index), |
| 381 additional_offset, INTPTR_PARAMETERS); | 374 additional_offset); |
| 382 } | 375 } |
| 383 // Load an array element from a FixedArray, untag it and return it as Word32. | 376 // Load an array element from a FixedArray, untag it and return it as Word32. |
| 384 Node* LoadAndUntagToWord32FixedArrayElement( | 377 Node* LoadAndUntagToWord32FixedArrayElement( |
| 385 Node* object, Node* index, int additional_offset = 0, | 378 Node* object, Node* index, int additional_offset = 0, |
| 386 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 379 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
| 387 // Load an array element from a FixedDoubleArray. | 380 // Load an array element from a FixedDoubleArray. |
| 388 Node* LoadFixedDoubleArrayElement( | 381 Node* LoadFixedDoubleArrayElement( |
| 389 Node* object, Node* index, MachineType machine_type, | 382 Node* object, Node* index, MachineType machine_type, |
| 390 int additional_offset = 0, | 383 int additional_offset = 0, |
| 391 ParameterMode parameter_mode = INTEGER_PARAMETERS, | 384 ParameterMode parameter_mode = INTPTR_PARAMETERS, |
| 392 Label* if_hole = nullptr); | 385 Label* if_hole = nullptr); |
| 393 | 386 |
| 394 // Load Float64 value by |base| + |offset| address. If the value is a double | 387 // Load Float64 value by |base| + |offset| address. If the value is a double |
| 395 // hole then jump to |if_hole|. If |machine_type| is None then only the hole | 388 // hole then jump to |if_hole|. If |machine_type| is None then only the hole |
| 396 // check is generated. | 389 // check is generated. |
| 397 Node* LoadDoubleWithHoleCheck( | 390 Node* LoadDoubleWithHoleCheck( |
| 398 Node* base, Node* offset, Label* if_hole, | 391 Node* base, Node* offset, Label* if_hole, |
| 399 MachineType machine_type = MachineType::Float64()); | 392 MachineType machine_type = MachineType::Float64()); |
| 400 Node* LoadFixedTypedArrayElement( | 393 Node* LoadFixedTypedArrayElement( |
| 401 Node* data_pointer, Node* index_node, ElementsKind elements_kind, | 394 Node* data_pointer, Node* index_node, ElementsKind elements_kind, |
| 402 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 395 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
| 403 | 396 |
| 404 // Context manipulation | 397 // Context manipulation |
| 405 Node* LoadContextElement(Node* context, int slot_index); | 398 Node* LoadContextElement(Node* context, int slot_index); |
| 406 Node* LoadContextElement(Node* context, Node* slot_index); | 399 Node* LoadContextElement(Node* context, Node* slot_index); |
| 407 Node* StoreContextElement(Node* context, int slot_index, Node* value); | 400 Node* StoreContextElement(Node* context, int slot_index, Node* value); |
| 408 Node* StoreContextElement(Node* context, Node* slot_index, Node* value); | 401 Node* StoreContextElement(Node* context, Node* slot_index, Node* value); |
| 409 Node* LoadNativeContext(Node* context); | 402 Node* LoadNativeContext(Node* context); |
| 410 | 403 |
| 411 Node* LoadJSArrayElementsMap(ElementsKind kind, Node* native_context); | 404 Node* LoadJSArrayElementsMap(ElementsKind kind, Node* native_context); |
| 412 | 405 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 426 Node* StoreMapNoWriteBarrier(Node* object, | 419 Node* StoreMapNoWriteBarrier(Node* object, |
| 427 Heap::RootListIndex map_root_index); | 420 Heap::RootListIndex map_root_index); |
| 428 Node* StoreMapNoWriteBarrier(Node* object, Node* map); | 421 Node* StoreMapNoWriteBarrier(Node* object, Node* map); |
| 429 Node* StoreObjectFieldRoot(Node* object, int offset, | 422 Node* StoreObjectFieldRoot(Node* object, int offset, |
| 430 Heap::RootListIndex root); | 423 Heap::RootListIndex root); |
| 431 // Store an array element to a FixedArray. | 424 // Store an array element to a FixedArray. |
| 432 Node* StoreFixedArrayElement( | 425 Node* StoreFixedArrayElement( |
| 433 Node* object, int index, Node* value, | 426 Node* object, int index, Node* value, |
| 434 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER) { | 427 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER) { |
| 435 return StoreFixedArrayElement(object, IntPtrConstant(index), value, | 428 return StoreFixedArrayElement(object, IntPtrConstant(index), value, |
| 436 barrier_mode, 0, INTPTR_PARAMETERS); | 429 barrier_mode); |
| 437 } | 430 } |
| 438 | 431 |
| 439 Node* StoreFixedArrayElement( | 432 Node* StoreFixedArrayElement( |
| 440 Node* object, Node* index, Node* value, | 433 Node* object, Node* index, Node* value, |
| 441 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 434 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
| 442 int additional_offset = 0, | 435 int additional_offset = 0, |
| 443 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 436 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
| 444 | 437 |
| 445 Node* StoreFixedDoubleArrayElement( | 438 Node* StoreFixedDoubleArrayElement( |
| 446 Node* object, Node* index, Node* value, | 439 Node* object, Node* index, Node* value, |
| 447 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 440 ParameterMode parameter_mode = INTPTR_PARAMETERS); |
| 448 | 441 |
| 449 Node* BuildAppendJSArray(ElementsKind kind, Node* context, Node* array, | 442 Node* BuildAppendJSArray(ElementsKind kind, Node* context, Node* array, |
| 450 CodeStubArguments& args, Variable& arg_index, | 443 CodeStubArguments& args, Variable& arg_index, |
| 451 Label* bailout); | 444 Label* bailout); |
| 452 | 445 |
| 453 void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address, | 446 void StoreFieldsNoWriteBarrier(Node* start_address, Node* end_address, |
| 454 Node* value); | 447 Node* value); |
| 455 | 448 |
| 456 // Allocate a HeapNumber without initializing its value. | 449 // Allocate a HeapNumber without initializing its value. |
| 457 Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); | 450 Node* AllocateHeapNumber(MutableMode mode = IMMUTABLE); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 // Allocate a JSArray without elements and initialize the header fields. | 507 // Allocate a JSArray without elements and initialize the header fields. |
| 515 Node* AllocateUninitializedJSArrayWithoutElements(ElementsKind kind, | 508 Node* AllocateUninitializedJSArrayWithoutElements(ElementsKind kind, |
| 516 Node* array_map, | 509 Node* array_map, |
| 517 Node* length, | 510 Node* length, |
| 518 Node* allocation_site); | 511 Node* allocation_site); |
| 519 // Allocate and return a JSArray with initialized header fields and its | 512 // Allocate and return a JSArray with initialized header fields and its |
| 520 // uninitialized elements. | 513 // uninitialized elements. |
| 521 // The ParameterMode argument is only used for the capacity parameter. | 514 // The ParameterMode argument is only used for the capacity parameter. |
| 522 std::pair<Node*, Node*> AllocateUninitializedJSArrayWithElements( | 515 std::pair<Node*, Node*> AllocateUninitializedJSArrayWithElements( |
| 523 ElementsKind kind, Node* array_map, Node* length, Node* allocation_site, | 516 ElementsKind kind, Node* array_map, Node* length, Node* allocation_site, |
| 524 Node* capacity, ParameterMode capacity_mode = INTEGER_PARAMETERS); | 517 Node* capacity, ParameterMode capacity_mode = INTPTR_PARAMETERS); |
| 525 // Allocate a JSArray and fill elements with the hole. | 518 // Allocate a JSArray and fill elements with the hole. |
| 526 // The ParameterMode argument is only used for the capacity parameter. | 519 // The ParameterMode argument is only used for the capacity parameter. |
| 527 Node* AllocateJSArray(ElementsKind kind, Node* array_map, Node* capacity, | 520 Node* AllocateJSArray(ElementsKind kind, Node* array_map, Node* capacity, |
| 528 Node* length, Node* allocation_site = nullptr, | 521 Node* length, Node* allocation_site = nullptr, |
| 529 ParameterMode capacity_mode = INTEGER_PARAMETERS); | 522 ParameterMode capacity_mode = INTPTR_PARAMETERS); |
| 530 | 523 |
| 531 Node* AllocateFixedArray(ElementsKind kind, Node* capacity, | 524 Node* AllocateFixedArray(ElementsKind kind, Node* capacity, |
| 532 ParameterMode mode = INTEGER_PARAMETERS, | 525 ParameterMode mode = INTPTR_PARAMETERS, |
| 533 AllocationFlags flags = kNone); | 526 AllocationFlags flags = kNone); |
| 534 | 527 |
| 535 // Perform CreateArrayIterator (ES6 #sec-createarrayiterator). | 528 // Perform CreateArrayIterator (ES6 #sec-createarrayiterator). |
| 536 Node* CreateArrayIterator(Node* array, Node* array_map, Node* array_type, | 529 Node* CreateArrayIterator(Node* array, Node* array_map, Node* array_type, |
| 537 Node* context, IterationKind mode); | 530 Node* context, IterationKind mode); |
| 538 | 531 |
| 539 Node* AllocateJSArrayIterator(Node* array, Node* array_map, Node* map); | 532 Node* AllocateJSArrayIterator(Node* array, Node* array_map, Node* map); |
| 540 | 533 |
| 541 void FillFixedArrayWithValue(ElementsKind kind, Node* array, Node* from_index, | 534 void FillFixedArrayWithValue(ElementsKind kind, Node* array, Node* from_index, |
| 542 Node* to_index, | 535 Node* to_index, |
| 543 Heap::RootListIndex value_root_index, | 536 Heap::RootListIndex value_root_index, |
| 544 ParameterMode mode = INTEGER_PARAMETERS); | 537 ParameterMode mode = INTPTR_PARAMETERS); |
| 545 | 538 |
| 546 // Copies all elements from |from_array| of |length| size to | 539 // Copies all elements from |from_array| of |length| size to |
| 547 // |to_array| of the same size respecting the elements kind. | 540 // |to_array| of the same size respecting the elements kind. |
| 548 void CopyFixedArrayElements( | 541 void CopyFixedArrayElements( |
| 549 ElementsKind kind, Node* from_array, Node* to_array, Node* length, | 542 ElementsKind kind, Node* from_array, Node* to_array, Node* length, |
| 550 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 543 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
| 551 ParameterMode mode = INTEGER_PARAMETERS) { | 544 ParameterMode mode = INTPTR_PARAMETERS) { |
| 552 CopyFixedArrayElements(kind, from_array, kind, to_array, length, length, | 545 CopyFixedArrayElements(kind, from_array, kind, to_array, length, length, |
| 553 barrier_mode, mode); | 546 barrier_mode, mode); |
| 554 } | 547 } |
| 555 | 548 |
| 556 // Copies |element_count| elements from |from_array| to |to_array| of | 549 // Copies |element_count| elements from |from_array| to |to_array| of |
| 557 // |capacity| size respecting both array's elements kinds. | 550 // |capacity| size respecting both array's elements kinds. |
| 558 void CopyFixedArrayElements( | 551 void CopyFixedArrayElements( |
| 559 ElementsKind from_kind, Node* from_array, ElementsKind to_kind, | 552 ElementsKind from_kind, Node* from_array, ElementsKind to_kind, |
| 560 Node* to_array, Node* element_count, Node* capacity, | 553 Node* to_array, Node* element_count, Node* capacity, |
| 561 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 554 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
| 562 ParameterMode mode = INTEGER_PARAMETERS); | 555 ParameterMode mode = INTPTR_PARAMETERS); |
| 563 | 556 |
| 564 // Copies |character_count| elements from |from_string| to |to_string| | 557 // Copies |character_count| elements from |from_string| to |to_string| |
| 565 // starting at the |from_index|'th character. |from_string| and |to_string| | 558 // starting at the |from_index|'th character. |from_string| and |to_string| |
| 566 // can either be one-byte strings or two-byte strings, although if | 559 // can either be one-byte strings or two-byte strings, although if |
| 567 // |from_string| is two-byte, then |to_string| must be two-byte. | 560 // |from_string| is two-byte, then |to_string| must be two-byte. |
| 568 // |from_index|, |to_index| and |character_count| must be either Smis or | 561 // |from_index|, |to_index| and |character_count| must be either Smis or |
| 569 // intptr_ts depending on |mode| s.t. 0 <= |from_index| <= |from_index| + | 562 // intptr_ts depending on |mode| s.t. 0 <= |from_index| <= |from_index| + |
| 570 // |character_count| <= from_string.length and 0 <= |to_index| <= |to_index| + | 563 // |character_count| <= from_string.length and 0 <= |to_index| <= |to_index| + |
| 571 // |character_count| <= to_string.length. | 564 // |character_count| <= to_string.length. |
| 572 void CopyStringCharacters(Node* from_string, Node* to_string, | 565 void CopyStringCharacters(Node* from_string, Node* to_string, |
| 573 Node* from_index, Node* to_index, | 566 Node* from_index, Node* to_index, |
| 574 Node* character_count, | 567 Node* character_count, |
| 575 String::Encoding from_encoding, | 568 String::Encoding from_encoding, |
| 576 String::Encoding to_encoding, ParameterMode mode); | 569 String::Encoding to_encoding, ParameterMode mode); |
| 577 | 570 |
| 578 // Loads an element from |array| of |from_kind| elements by given |offset| | 571 // Loads an element from |array| of |from_kind| elements by given |offset| |
| 579 // (NOTE: not index!), does a hole check if |if_hole| is provided and | 572 // (NOTE: not index!), does a hole check if |if_hole| is provided and |
| 580 // converts the value so that it becomes ready for storing to array of | 573 // converts the value so that it becomes ready for storing to array of |
| 581 // |to_kind| elements. | 574 // |to_kind| elements. |
| 582 Node* LoadElementAndPrepareForStore(Node* array, Node* offset, | 575 Node* LoadElementAndPrepareForStore(Node* array, Node* offset, |
| 583 ElementsKind from_kind, | 576 ElementsKind from_kind, |
| 584 ElementsKind to_kind, Label* if_hole); | 577 ElementsKind to_kind, Label* if_hole); |
| 585 | 578 |
| 586 Node* CalculateNewElementsCapacity(Node* old_capacity, | 579 Node* CalculateNewElementsCapacity(Node* old_capacity, |
| 587 ParameterMode mode = INTEGER_PARAMETERS); | 580 ParameterMode mode = INTPTR_PARAMETERS); |
| 588 | 581 |
| 589 // Tries to grow the |elements| array of given |object| to store the |key| | 582 // Tries to grow the |elements| array of given |object| to store the |key| |
| 590 // or bails out if the growing gap is too big. Returns new elements. | 583 // or bails out if the growing gap is too big. Returns new elements. |
| 591 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, | 584 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, |
| 592 Node* key, Label* bailout); | 585 Node* key, Label* bailout); |
| 593 | 586 |
| 594 // Tries to grow the |capacity|-length |elements| array of given |object| | 587 // Tries to grow the |capacity|-length |elements| array of given |object| |
| 595 // to store the |key| or bails out if the growing gap is too big. Returns | 588 // to store the |key| or bails out if the growing gap is too big. Returns |
| 596 // new elements. | 589 // new elements. |
| 597 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, | 590 Node* TryGrowElementsCapacity(Node* object, Node* elements, ElementsKind kind, |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 } | 1200 } |
| 1208 #else | 1201 #else |
| 1209 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1202 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
| 1210 #endif | 1203 #endif |
| 1211 | 1204 |
| 1212 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1205 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 1213 | 1206 |
| 1214 } // namespace internal | 1207 } // namespace internal |
| 1215 } // namespace v8 | 1208 } // namespace v8 |
| 1216 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1209 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |