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 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1449 | 1449 |
1450 static const int kElementLoopUnrollThreshold = 8; | 1450 static const int kElementLoopUnrollThreshold = 8; |
1451 }; | 1451 }; |
1452 | 1452 |
1453 class CodeStubArguments { | 1453 class CodeStubArguments { |
1454 public: | 1454 public: |
1455 typedef compiler::Node Node; | 1455 typedef compiler::Node Node; |
1456 | 1456 |
1457 // |argc| is an uint32 value which specifies the number of arguments passed | 1457 // |argc| is an uint32 value which specifies the number of arguments passed |
1458 // to the builtin excluding the receiver. | 1458 // to the builtin excluding the receiver. |
1459 CodeStubArguments(CodeStubAssembler* assembler, Node* argc) | 1459 CodeStubArguments(CodeStubAssembler* assembler, Node* argc) |
Igor Sheludko
2017/04/27 10:38:05
While you are here please update the comment. It l
danno
2017/04/28 06:58:10
Done.
| |
1460 : CodeStubArguments(assembler, argc, nullptr, | 1460 : CodeStubArguments(assembler, argc, nullptr, |
1461 CodeStubAssembler::INTPTR_PARAMETERS) {} | 1461 CodeStubAssembler::INTPTR_PARAMETERS) {} |
1462 CodeStubArguments(CodeStubAssembler* assembler, Node* argc, Node* fp, | 1462 CodeStubArguments(CodeStubAssembler* assembler, Node* argc, Node* fp, |
1463 CodeStubAssembler::ParameterMode param_mode); | 1463 CodeStubAssembler::ParameterMode param_mode); |
1464 | 1464 |
1465 Node* GetReceiver() const; | 1465 Node* GetReceiver() const; |
1466 | 1466 |
1467 Node* AtIndexPtr(Node* index, CodeStubAssembler::ParameterMode mode = | 1467 Node* AtIndexPtr(Node* index, CodeStubAssembler::ParameterMode mode = |
1468 CodeStubAssembler::INTPTR_PARAMETERS) const; | 1468 CodeStubAssembler::INTPTR_PARAMETERS) const; |
1469 | 1469 |
1470 // |index| is zero-based and does not include the receiver | 1470 // |index| is zero-based and does not include the receiver |
1471 Node* AtIndex(Node* index, CodeStubAssembler::ParameterMode mode = | 1471 Node* AtIndex(Node* index, CodeStubAssembler::ParameterMode mode = |
1472 CodeStubAssembler::INTPTR_PARAMETERS) const; | 1472 CodeStubAssembler::INTPTR_PARAMETERS) const; |
1473 | 1473 |
1474 Node* AtIndex(int index) const; | 1474 Node* AtIndex(int index) const; |
1475 | 1475 |
1476 Node* GetOptionalArgumentValue(int index, Node* default_value); | |
1477 | |
1476 Node* GetLength() const { return argc_; } | 1478 Node* GetLength() const { return argc_; } |
1477 | 1479 |
1478 typedef std::function<void(Node* arg)> ForEachBodyFunction; | 1480 typedef std::function<void(Node* arg)> ForEachBodyFunction; |
1479 | 1481 |
1480 // Iteration doesn't include the receiver. |first| and |last| are zero-based. | 1482 // Iteration doesn't include the receiver. |first| and |last| are zero-based. |
1481 void ForEach(const ForEachBodyFunction& body, Node* first = nullptr, | 1483 void ForEach(const ForEachBodyFunction& body, Node* first = nullptr, |
1482 Node* last = nullptr, CodeStubAssembler::ParameterMode mode = | 1484 Node* last = nullptr, CodeStubAssembler::ParameterMode mode = |
1483 CodeStubAssembler::INTPTR_PARAMETERS) { | 1485 CodeStubAssembler::INTPTR_PARAMETERS) { |
1484 CodeStubAssembler::VariableList list(0, assembler_->zone()); | 1486 CodeStubAssembler::VariableList list(0, assembler_->zone()); |
1485 ForEach(list, body, first, last); | 1487 ForEach(list, body, first, last); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1572 } | 1574 } |
1573 #else | 1575 #else |
1574 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1576 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1575 #endif | 1577 #endif |
1576 | 1578 |
1577 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1579 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1578 | 1580 |
1579 } // namespace internal | 1581 } // namespace internal |
1580 } // namespace v8 | 1582 } // namespace v8 |
1581 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1583 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |