| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 compiler::Node* capacity, | 326 compiler::Node* capacity, |
| 327 ParameterMode mode = INTEGER_PARAMETERS, | 327 ParameterMode mode = INTEGER_PARAMETERS, |
| 328 AllocationFlags flags = kNone); | 328 AllocationFlags flags = kNone); |
| 329 | 329 |
| 330 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array, | 330 void FillFixedArrayWithValue(ElementsKind kind, compiler::Node* array, |
| 331 compiler::Node* from_index, | 331 compiler::Node* from_index, |
| 332 compiler::Node* to_index, | 332 compiler::Node* to_index, |
| 333 Heap::RootListIndex value_root_index, | 333 Heap::RootListIndex value_root_index, |
| 334 ParameterMode mode = INTEGER_PARAMETERS); | 334 ParameterMode mode = INTEGER_PARAMETERS); |
| 335 | 335 |
| 336 // Copies all elements from |from_array| of |length| size to |
| 337 // |to_array| of the same size respecting the elements kind. |
| 336 void CopyFixedArrayElements( | 338 void CopyFixedArrayElements( |
| 337 ElementsKind kind, compiler::Node* from_array, compiler::Node* to_array, | 339 ElementsKind kind, compiler::Node* from_array, compiler::Node* to_array, |
| 338 compiler::Node* element_count, | 340 compiler::Node* length, |
| 341 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
| 342 ParameterMode mode = INTEGER_PARAMETERS) { |
| 343 CopyFixedArrayElements(kind, from_array, kind, to_array, length, length, |
| 344 barrier_mode, mode); |
| 345 } |
| 346 |
| 347 // Copies |element_count| elements from |from_array| to |to_array| of |
| 348 // |capacity| size respecting both array's elements kinds. |
| 349 void CopyFixedArrayElements( |
| 350 ElementsKind from_kind, compiler::Node* from_array, ElementsKind to_kind, |
| 351 compiler::Node* to_array, compiler::Node* element_count, |
| 352 compiler::Node* capacity, |
| 339 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 353 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
| 340 ParameterMode mode = INTEGER_PARAMETERS); | 354 ParameterMode mode = INTEGER_PARAMETERS); |
| 341 | 355 |
| 356 // Loads an element from |array| of |from_kind| elements by given |offset| |
| 357 // (NOTE: not index!), does a hole check if |if_hole| is provided and |
| 358 // converts the value so that it becomes ready for storing to array of |
| 359 // |to_kind| elements. |
| 360 compiler::Node* LoadElementAndPrepareForStore(compiler::Node* array, |
| 361 compiler::Node* offset, |
| 362 ElementsKind from_kind, |
| 363 ElementsKind to_kind, |
| 364 Label* if_hole); |
| 365 |
| 342 compiler::Node* CalculateNewElementsCapacity( | 366 compiler::Node* CalculateNewElementsCapacity( |
| 343 compiler::Node* old_capacity, ParameterMode mode = INTEGER_PARAMETERS); | 367 compiler::Node* old_capacity, ParameterMode mode = INTEGER_PARAMETERS); |
| 344 | 368 |
| 345 compiler::Node* CheckAndGrowElementsCapacity(compiler::Node* context, | 369 compiler::Node* CheckAndGrowElementsCapacity(compiler::Node* context, |
| 346 compiler::Node* elements, | 370 compiler::Node* elements, |
| 347 ElementsKind kind, | 371 ElementsKind kind, |
| 348 compiler::Node* key, | 372 compiler::Node* key, |
| 349 Label* fail); | 373 Label* fail); |
| 350 | 374 |
| 351 // Allocation site manipulation | 375 // Allocation site manipulation |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 compiler::Node* SmiShiftBitsConstant(); | 676 compiler::Node* SmiShiftBitsConstant(); |
| 653 | 677 |
| 654 static const int kElementLoopUnrollThreshold = 8; | 678 static const int kElementLoopUnrollThreshold = 8; |
| 655 }; | 679 }; |
| 656 | 680 |
| 657 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 681 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 658 | 682 |
| 659 } // namespace internal | 683 } // namespace internal |
| 660 } // namespace v8 | 684 } // namespace v8 |
| 661 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 685 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |