OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 18 matching lines...) Expand all Loading... |
29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | 30 |
31 // The original source code covered by the above license above has been | 31 // The original source code covered by the above license above has been |
32 // modified significantly by Google Inc. | 32 // modified significantly by Google Inc. |
33 // Copyright 2011 the V8 project authors. All rights reserved. | 33 // Copyright 2011 the V8 project authors. All rights reserved. |
34 | 34 |
35 #ifndef V8_ASSEMBLER_H_ | 35 #ifndef V8_ASSEMBLER_H_ |
36 #define V8_ASSEMBLER_H_ | 36 #define V8_ASSEMBLER_H_ |
37 | 37 |
38 #include "allocation.h" | 38 #include "allocation.h" |
| 39 #include "api.h" |
39 #include "gdb-jit.h" | 40 #include "gdb-jit.h" |
40 #include "runtime.h" | 41 #include "runtime.h" |
41 #include "token.h" | 42 #include "token.h" |
42 | 43 |
43 namespace v8 { | 44 namespace v8 { |
44 namespace internal { | 45 namespace internal { |
45 | 46 |
46 const unsigned kNoASTId = -1; | 47 const unsigned kNoASTId = -1; |
47 // ----------------------------------------------------------------------------- | 48 // ----------------------------------------------------------------------------- |
48 // Platform independent assembler base class. | 49 // Platform independent assembler base class. |
49 | 50 |
50 class AssemblerBase: public Malloced { | 51 class AssemblerBase: public Malloced { |
51 public: | 52 public: |
52 explicit AssemblerBase(Isolate* isolate); | 53 explicit AssemblerBase(Isolate* isolate); |
53 | 54 |
54 Isolate* isolate() const { return isolate_; } | 55 Isolate* isolate() const { return isolate_; } |
55 int jit_cookie() { return jit_cookie_; } | 56 int jit_cookie() { return jit_cookie_; } |
56 | 57 |
57 private: | 58 private: |
58 Isolate* isolate_; | 59 Isolate* isolate_; |
59 int jit_cookie_; | 60 int jit_cookie_; |
60 }; | 61 }; |
61 | 62 |
| 63 static const uint32_t kHoleNanUpper32 = 0x7FFFFFFF; |
| 64 static const uint32_t kHoleNanLower32 = 0xFFFFFFFF; |
| 65 static const uint32_t kCanonicalNonHoleNanUpper32 = 0x7FF10000; |
| 66 static const uint32_t kCanonicalNonHoleNanLower32 = 0xFFFFFFFF; |
| 67 |
| 68 extern uint64_t kHoleNanInt64; |
| 69 extern uint64_t kCanonicalNonHoleNanInt64; |
| 70 |
62 // ----------------------------------------------------------------------------- | 71 // ----------------------------------------------------------------------------- |
63 // Common double constants. | 72 // Common double constants. |
64 | 73 |
65 class DoubleConstant: public AllStatic { | 74 class DoubleConstant: public AllStatic { |
66 public: | 75 public: |
67 static const double min_int; | 76 static const double min_int; |
68 static const double one_half; | 77 static const double one_half; |
69 static const double minus_zero; | 78 static const double minus_zero; |
70 static const double zero; | 79 static const double zero; |
71 static const double uint8_max_value; | 80 static const double uint8_max_value; |
72 static const double negative_infinity; | 81 static const double negative_infinity; |
73 static const double nan; | 82 static const double nan; |
| 83 static const double canonical_non_hole_nan; |
| 84 static const double the_hole_nan; |
74 }; | 85 }; |
75 | 86 |
76 | 87 |
77 // ----------------------------------------------------------------------------- | 88 // ----------------------------------------------------------------------------- |
78 // Labels represent pc locations; they are typically jump or call targets. | 89 // Labels represent pc locations; they are typically jump or call targets. |
79 // After declaration, a label can be freely used to denote known or (yet) | 90 // After declaration, a label can be freely used to denote known or (yet) |
80 // unknown pc location. Assembler::bind() is used to bind a label to the | 91 // unknown pc location. Assembler::bind() is used to bind a label to the |
81 // current pc. A label can be bound only once. | 92 // current pc. A label can be bound only once. |
82 | 93 |
83 class Label BASE_EMBEDDED { | 94 class Label BASE_EMBEDDED { |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 633 |
623 static ExternalReference scheduled_exception_address(Isolate* isolate); | 634 static ExternalReference scheduled_exception_address(Isolate* isolate); |
624 | 635 |
625 // Static variables containing common double constants. | 636 // Static variables containing common double constants. |
626 static ExternalReference address_of_min_int(); | 637 static ExternalReference address_of_min_int(); |
627 static ExternalReference address_of_one_half(); | 638 static ExternalReference address_of_one_half(); |
628 static ExternalReference address_of_minus_zero(); | 639 static ExternalReference address_of_minus_zero(); |
629 static ExternalReference address_of_zero(); | 640 static ExternalReference address_of_zero(); |
630 static ExternalReference address_of_uint8_max_value(); | 641 static ExternalReference address_of_uint8_max_value(); |
631 static ExternalReference address_of_negative_infinity(); | 642 static ExternalReference address_of_negative_infinity(); |
632 static ExternalReference address_of_nan(); | 643 static ExternalReference address_of_canonical_non_hole_nan(); |
| 644 static ExternalReference address_of_the_hole_nan(); |
633 | 645 |
634 static ExternalReference math_sin_double_function(Isolate* isolate); | 646 static ExternalReference math_sin_double_function(Isolate* isolate); |
635 static ExternalReference math_cos_double_function(Isolate* isolate); | 647 static ExternalReference math_cos_double_function(Isolate* isolate); |
636 static ExternalReference math_log_double_function(Isolate* isolate); | 648 static ExternalReference math_log_double_function(Isolate* isolate); |
637 | 649 |
638 Address address() const {return reinterpret_cast<Address>(address_);} | 650 Address address() const {return reinterpret_cast<Address>(address_);} |
639 | 651 |
640 #ifdef ENABLE_DEBUGGER_SUPPORT | 652 #ifdef ENABLE_DEBUGGER_SUPPORT |
641 // Function Debug::Break() | 653 // Function Debug::Break() |
642 static ExternalReference debug_break(Isolate* isolate); | 654 static ExternalReference debug_break(Isolate* isolate); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 public: | 865 public: |
854 NullCallWrapper() { } | 866 NullCallWrapper() { } |
855 virtual ~NullCallWrapper() { } | 867 virtual ~NullCallWrapper() { } |
856 virtual void BeforeCall(int call_size) const { } | 868 virtual void BeforeCall(int call_size) const { } |
857 virtual void AfterCall() const { } | 869 virtual void AfterCall() const { } |
858 }; | 870 }; |
859 | 871 |
860 } } // namespace v8::internal | 872 } } // namespace v8::internal |
861 | 873 |
862 #endif // V8_ASSEMBLER_H_ | 874 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |