Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: src/assembler.h

Issue 1030353003: Enable constant pool support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void set_predictable_code_size(bool value) { predictable_code_size_ = value; } 72 void set_predictable_code_size(bool value) { predictable_code_size_ = value; }
73 73
74 uint64_t enabled_cpu_features() const { return enabled_cpu_features_; } 74 uint64_t enabled_cpu_features() const { return enabled_cpu_features_; }
75 void set_enabled_cpu_features(uint64_t features) { 75 void set_enabled_cpu_features(uint64_t features) {
76 enabled_cpu_features_ = features; 76 enabled_cpu_features_ = features;
77 } 77 }
78 bool IsEnabled(CpuFeature f) { 78 bool IsEnabled(CpuFeature f) {
79 return (enabled_cpu_features_ & (static_cast<uint64_t>(1) << f)) != 0; 79 return (enabled_cpu_features_ & (static_cast<uint64_t>(1) << f)) != 0;
80 } 80 }
81 81
82 bool is_ool_constant_pool_available() const { 82 bool is_constant_pool_available() const {
83 if (FLAG_enable_ool_constant_pool) { 83 if (FLAG_enable_ool_constant_pool || FLAG_enable_embedded_constant_pool) {
84 return ool_constant_pool_available_; 84 return constant_pool_available_;
85 } else { 85 } else {
86 // Out-of-line constant pool not supported on this architecture. 86 // Constant pool not supported on this architecture.
87 UNREACHABLE(); 87 UNREACHABLE();
88 return false; 88 return false;
89 } 89 }
90 } 90 }
91 91
92 // Overwrite a host NaN with a quiet target NaN. Used by mksnapshot for 92 // Overwrite a host NaN with a quiet target NaN. Used by mksnapshot for
93 // cross-snapshotting. 93 // cross-snapshotting.
94 static void QuietNaN(HeapObject* nan) { } 94 static void QuietNaN(HeapObject* nan) { }
95 95
96 int pc_offset() const { return static_cast<int>(pc_ - buffer_); } 96 int pc_offset() const { return static_cast<int>(pc_ - buffer_); }
97 97
98 // This function is called when code generation is aborted, so that 98 // This function is called when code generation is aborted, so that
99 // the assembler could clean up internal data structures. 99 // the assembler could clean up internal data structures.
100 virtual void AbortedCodeGeneration() { } 100 virtual void AbortedCodeGeneration() { }
101 101
102 static const int kMinimalBufferSize = 4*KB; 102 static const int kMinimalBufferSize = 4*KB;
103 103
104 protected: 104 protected:
105 // The buffer into which code and relocation info are generated. It could 105 // The buffer into which code and relocation info are generated. It could
106 // either be owned by the assembler or be provided externally. 106 // either be owned by the assembler or be provided externally.
107 byte* buffer_; 107 byte* buffer_;
108 int buffer_size_; 108 int buffer_size_;
109 bool own_buffer_; 109 bool own_buffer_;
110 110
111 void set_ool_constant_pool_available(bool available) { 111 void set_constant_pool_available(bool available) {
112 if (FLAG_enable_ool_constant_pool) { 112 if (FLAG_enable_ool_constant_pool || FLAG_enable_embedded_constant_pool) {
113 ool_constant_pool_available_ = available; 113 constant_pool_available_ = available;
114 } else { 114 } else {
115 // Out-of-line constant pool not supported on this architecture. 115 // Constant pool not supported on this architecture.
116 UNREACHABLE(); 116 UNREACHABLE();
117 } 117 }
118 } 118 }
119 119
120 // The program counter, which points into the buffer above and moves forward. 120 // The program counter, which points into the buffer above and moves forward.
121 byte* pc_; 121 byte* pc_;
122 122
123 private: 123 private:
124 Isolate* isolate_; 124 Isolate* isolate_;
125 int jit_cookie_; 125 int jit_cookie_;
126 uint64_t enabled_cpu_features_; 126 uint64_t enabled_cpu_features_;
127 bool emit_debug_code_; 127 bool emit_debug_code_;
128 bool predictable_code_size_; 128 bool predictable_code_size_;
129 bool serializer_enabled_; 129 bool serializer_enabled_;
130 130
131 // Indicates whether the constant pool can be accessed, which is only possible 131 // Indicates whether the constant pool can be accessed, which is only possible
132 // if the pp register points to the current code object's constant pool. 132 // if the pp register points to the current code object's constant pool.
133 bool ool_constant_pool_available_; 133 bool constant_pool_available_;
134 134
135 // Constant pool. 135 // Constant pool.
136 friend class FrameAndConstantPoolScope; 136 friend class FrameAndConstantPoolScope;
137 friend class ConstantPoolUnavailableScope; 137 friend class ConstantPoolUnavailableScope;
138 }; 138 };
139 139
140 140
141 // Avoids emitting debug code during the lifetime of this scope object. 141 // Avoids emitting debug code during the lifetime of this scope object.
142 class DontEmitDebugCodeScope BASE_EMBEDDED { 142 class DontEmitDebugCodeScope BASE_EMBEDDED {
143 public: 143 public:
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 // all external references in the code so that they can be bound to the correct 808 // all external references in the code so that they can be bound to the correct
809 // addresses when deserializing a heap. 809 // addresses when deserializing a heap.
810 class ExternalReference BASE_EMBEDDED { 810 class ExternalReference BASE_EMBEDDED {
811 public: 811 public:
812 // Used in the simulator to support different native api calls. 812 // Used in the simulator to support different native api calls.
813 enum Type { 813 enum Type {
814 // Builtin call. 814 // Builtin call.
815 // Object* f(v8::internal::Arguments). 815 // Object* f(v8::internal::Arguments).
816 BUILTIN_CALL, // default 816 BUILTIN_CALL, // default
817 817
818
818 // Builtin that takes float arguments and returns an int. 819 // Builtin that takes float arguments and returns an int.
819 // int f(double, double). 820 // int f(double, double).
820 BUILTIN_COMPARE_CALL, 821 BUILTIN_COMPARE_CALL,
821 822
822 // Builtin call that returns floating point. 823 // Builtin call that returns floating point.
823 // double f(double, double). 824 // double f(double, double).
824 BUILTIN_FP_FP_CALL, 825 BUILTIN_FP_FP_CALL,
825 826
826 // Builtin call that returns floating point. 827 // Builtin call that returns floating point.
827 // double f(double). 828 // double f(double).
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 NullCallWrapper() { } 1169 NullCallWrapper() { }
1169 virtual ~NullCallWrapper() { } 1170 virtual ~NullCallWrapper() { }
1170 virtual void BeforeCall(int call_size) const { } 1171 virtual void BeforeCall(int call_size) const { }
1171 virtual void AfterCall() const { } 1172 virtual void AfterCall() const { }
1172 }; 1173 };
1173 1174
1174 1175
1175 } } // namespace v8::internal 1176 } } // namespace v8::internal
1176 1177
1177 #endif // V8_ASSEMBLER_H_ 1178 #endif // V8_ASSEMBLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698