| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_BUILTINS_H_ | 5 #ifndef V8_BUILTINS_H_ |
| 6 #define V8_BUILTINS_H_ | 6 #define V8_BUILTINS_H_ |
| 7 | 7 |
| 8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
| 9 #include "src/handles.h" | 9 #include "src/handles.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 | 13 |
| 14 namespace compiler { | |
| 15 | |
| 16 // Forward declarations. | 14 // Forward declarations. |
| 17 class CodeStubAssembler; | 15 class CodeStubAssembler; |
| 18 | 16 |
| 19 } // namespace compiler | |
| 20 | |
| 21 // Specifies extra arguments required by a C++ builtin. | 17 // Specifies extra arguments required by a C++ builtin. |
| 22 enum class BuiltinExtraArguments : uint8_t { | 18 enum class BuiltinExtraArguments : uint8_t { |
| 23 kNone = 0u, | 19 kNone = 0u, |
| 24 kTarget = 1u << 0, | 20 kTarget = 1u << 0, |
| 25 kNewTarget = 1u << 1, | 21 kNewTarget = 1u << 1, |
| 26 kTargetAndNewTarget = kTarget | kNewTarget | 22 kTargetAndNewTarget = kTarget | kNewTarget |
| 27 }; | 23 }; |
| 28 | 24 |
| 29 inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) { | 25 inline bool operator&(BuiltinExtraArguments lhs, BuiltinExtraArguments rhs) { |
| 30 return static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs); | 26 return static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs); |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 static void Generate_FunctionPrototypeApply(MacroAssembler* masm); | 577 static void Generate_FunctionPrototypeApply(MacroAssembler* masm); |
| 582 static void Generate_FunctionPrototypeCall(MacroAssembler* masm); | 578 static void Generate_FunctionPrototypeCall(MacroAssembler* masm); |
| 583 | 579 |
| 584 static void Generate_ReflectApply(MacroAssembler* masm); | 580 static void Generate_ReflectApply(MacroAssembler* masm); |
| 585 static void Generate_ReflectConstruct(MacroAssembler* masm); | 581 static void Generate_ReflectConstruct(MacroAssembler* masm); |
| 586 | 582 |
| 587 static void Generate_InternalArrayCode(MacroAssembler* masm); | 583 static void Generate_InternalArrayCode(MacroAssembler* masm); |
| 588 static void Generate_ArrayCode(MacroAssembler* masm); | 584 static void Generate_ArrayCode(MacroAssembler* masm); |
| 589 | 585 |
| 590 // ES6 section 20.2.2.10 Math.ceil ( x ) | 586 // ES6 section 20.2.2.10 Math.ceil ( x ) |
| 591 static void Generate_MathCeil(compiler::CodeStubAssembler* assembler); | 587 static void Generate_MathCeil(CodeStubAssembler* assembler); |
| 592 // ES6 section 20.2.2.11 Math.clz32 ( x ) | 588 // ES6 section 20.2.2.11 Math.clz32 ( x ) |
| 593 static void Generate_MathClz32(compiler::CodeStubAssembler* assembler); | 589 static void Generate_MathClz32(CodeStubAssembler* assembler); |
| 594 // ES6 section 20.2.2.16 Math.floor ( x ) | 590 // ES6 section 20.2.2.16 Math.floor ( x ) |
| 595 static void Generate_MathFloor(compiler::CodeStubAssembler* assembler); | 591 static void Generate_MathFloor(CodeStubAssembler* assembler); |
| 596 enum class MathMaxMinKind { kMax, kMin }; | 592 enum class MathMaxMinKind { kMax, kMin }; |
| 597 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); | 593 static void Generate_MathMaxMin(MacroAssembler* masm, MathMaxMinKind kind); |
| 598 // ES6 section 20.2.2.24 Math.max ( value1, value2 , ...values ) | 594 // ES6 section 20.2.2.24 Math.max ( value1, value2 , ...values ) |
| 599 static void Generate_MathMax(MacroAssembler* masm) { | 595 static void Generate_MathMax(MacroAssembler* masm) { |
| 600 Generate_MathMaxMin(masm, MathMaxMinKind::kMax); | 596 Generate_MathMaxMin(masm, MathMaxMinKind::kMax); |
| 601 } | 597 } |
| 602 // ES6 section 20.2.2.25 Math.min ( value1, value2 , ...values ) | 598 // ES6 section 20.2.2.25 Math.min ( value1, value2 , ...values ) |
| 603 static void Generate_MathMin(MacroAssembler* masm) { | 599 static void Generate_MathMin(MacroAssembler* masm) { |
| 604 Generate_MathMaxMin(masm, MathMaxMinKind::kMin); | 600 Generate_MathMaxMin(masm, MathMaxMinKind::kMin); |
| 605 } | 601 } |
| 606 // ES6 section 20.2.2.28 Math.round ( x ) | 602 // ES6 section 20.2.2.28 Math.round ( x ) |
| 607 static void Generate_MathRound(compiler::CodeStubAssembler* assembler); | 603 static void Generate_MathRound(CodeStubAssembler* assembler); |
| 608 // ES6 section 20.2.2.32 Math.sqrt ( x ) | 604 // ES6 section 20.2.2.32 Math.sqrt ( x ) |
| 609 static void Generate_MathSqrt(compiler::CodeStubAssembler* assembler); | 605 static void Generate_MathSqrt(CodeStubAssembler* assembler); |
| 610 // ES6 section 20.2.2.35 Math.trunc ( x ) | 606 // ES6 section 20.2.2.35 Math.trunc ( x ) |
| 611 static void Generate_MathTrunc(compiler::CodeStubAssembler* assembler); | 607 static void Generate_MathTrunc(CodeStubAssembler* assembler); |
| 612 | 608 |
| 613 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case. | 609 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Call]] case. |
| 614 static void Generate_NumberConstructor(MacroAssembler* masm); | 610 static void Generate_NumberConstructor(MacroAssembler* masm); |
| 615 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case. | 611 // ES6 section 20.1.1.1 Number ( [ value ] ) for the [[Construct]] case. |
| 616 static void Generate_NumberConstructor_ConstructStub(MacroAssembler* masm); | 612 static void Generate_NumberConstructor_ConstructStub(MacroAssembler* masm); |
| 617 | 613 |
| 618 // ES6 section 25.3.1.2 Generator.prototype.next ( value ) | 614 // ES6 section 25.3.1.2 Generator.prototype.next ( value ) |
| 619 static void Generate_GeneratorPrototypeNext( | 615 static void Generate_GeneratorPrototypeNext(CodeStubAssembler* assembler); |
| 620 compiler::CodeStubAssembler* assembler); | |
| 621 // ES6 section 25.3.1.3 Generator.prototype.return ( value ) | 616 // ES6 section 25.3.1.3 Generator.prototype.return ( value ) |
| 622 static void Generate_GeneratorPrototypeReturn( | 617 static void Generate_GeneratorPrototypeReturn(CodeStubAssembler* assembler); |
| 623 compiler::CodeStubAssembler* assembler); | |
| 624 // ES6 section 25.3.1.4 Generator.prototype.throw ( exception ) | 618 // ES6 section 25.3.1.4 Generator.prototype.throw ( exception ) |
| 625 static void Generate_GeneratorPrototypeThrow( | 619 static void Generate_GeneratorPrototypeThrow(CodeStubAssembler* assembler); |
| 626 compiler::CodeStubAssembler* assembler); | |
| 627 | 620 |
| 628 // ES6 section 19.1.3.2 Object.prototype.hasOwnProperty | 621 // ES6 section 19.1.3.2 Object.prototype.hasOwnProperty |
| 629 static void Generate_ObjectHasOwnProperty( | 622 static void Generate_ObjectHasOwnProperty(CodeStubAssembler* assembler); |
| 630 compiler::CodeStubAssembler* assembler); | |
| 631 | 623 |
| 632 static void Generate_StringConstructor(MacroAssembler* masm); | 624 static void Generate_StringConstructor(MacroAssembler* masm); |
| 633 static void Generate_StringConstructor_ConstructStub(MacroAssembler* masm); | 625 static void Generate_StringConstructor_ConstructStub(MacroAssembler* masm); |
| 634 static void Generate_OnStackReplacement(MacroAssembler* masm); | 626 static void Generate_OnStackReplacement(MacroAssembler* masm); |
| 635 static void Generate_InterruptCheck(MacroAssembler* masm); | 627 static void Generate_InterruptCheck(MacroAssembler* masm); |
| 636 static void Generate_StackCheck(MacroAssembler* masm); | 628 static void Generate_StackCheck(MacroAssembler* masm); |
| 637 | 629 |
| 638 static void Generate_InterpreterEntryTrampoline(MacroAssembler* masm); | 630 static void Generate_InterpreterEntryTrampoline(MacroAssembler* masm); |
| 639 static void Generate_InterpreterExitTrampoline(MacroAssembler* masm); | 631 static void Generate_InterpreterExitTrampoline(MacroAssembler* masm); |
| 640 static void Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { | 632 static void Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 671 friend class BuiltinFunctionTable; | 663 friend class BuiltinFunctionTable; |
| 672 friend class Isolate; | 664 friend class Isolate; |
| 673 | 665 |
| 674 DISALLOW_COPY_AND_ASSIGN(Builtins); | 666 DISALLOW_COPY_AND_ASSIGN(Builtins); |
| 675 }; | 667 }; |
| 676 | 668 |
| 677 } // namespace internal | 669 } // namespace internal |
| 678 } // namespace v8 | 670 } // namespace v8 |
| 679 | 671 |
| 680 #endif // V8_BUILTINS_H_ | 672 #endif // V8_BUILTINS_H_ |
| OLD | NEW |