Chromium Code Reviews| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 { | |
| 83 if (FLAG_enable_ool_constant_pool) { | |
| 84 return ool_constant_pool_available_; | |
| 85 } else { | |
| 86 // Out-of-line constant pool not supported on this architecture. | |
| 87 UNREACHABLE(); | |
| 88 return false; | |
| 89 } | |
| 90 } | |
| 91 | |
| 82 // 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 |
| 83 // cross-snapshotting. | 93 // cross-snapshotting. |
| 84 static void QuietNaN(HeapObject* nan) { } | 94 static void QuietNaN(HeapObject* nan) { } |
| 85 | 95 |
| 86 int pc_offset() const { return static_cast<int>(pc_ - buffer_); } | 96 int pc_offset() const { return static_cast<int>(pc_ - buffer_); } |
| 87 | 97 |
| 88 // This function is called when code generation is aborted, so that | 98 // This function is called when code generation is aborted, so that |
| 89 // the assembler could clean up internal data structures. | 99 // the assembler could clean up internal data structures. |
| 90 virtual void AbortedCodeGeneration() { } | 100 virtual void AbortedCodeGeneration() { } |
| 91 | 101 |
| 92 static const int kMinimalBufferSize = 4*KB; | 102 static const int kMinimalBufferSize = 4*KB; |
| 93 | 103 |
| 94 protected: | 104 protected: |
| 95 // 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 |
| 96 // either be owned by the assembler or be provided externally. | 106 // either be owned by the assembler or be provided externally. |
| 97 byte* buffer_; | 107 byte* buffer_; |
| 98 int buffer_size_; | 108 int buffer_size_; |
| 99 bool own_buffer_; | 109 bool own_buffer_; |
| 100 | 110 |
| 111 void set_ool_constant_pool_available(bool available) { | |
| 112 if (FLAG_enable_ool_constant_pool) { | |
| 113 ool_constant_pool_available_ = available; | |
| 114 } else { | |
| 115 // Out-of-line constant pool not supported on this architecture. | |
| 116 UNREACHABLE(); | |
| 117 } | |
| 118 } | |
| 119 | |
| 101 // 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. |
| 102 byte* pc_; | 121 byte* pc_; |
| 103 | 122 |
| 104 private: | 123 private: |
| 105 Isolate* isolate_; | 124 Isolate* isolate_; |
| 106 int jit_cookie_; | 125 int jit_cookie_; |
| 107 uint64_t enabled_cpu_features_; | 126 uint64_t enabled_cpu_features_; |
| 108 bool emit_debug_code_; | 127 bool emit_debug_code_; |
| 109 bool predictable_code_size_; | 128 bool predictable_code_size_; |
| 110 bool serializer_enabled_; | 129 bool serializer_enabled_; |
| 130 | |
| 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. | |
| 133 bool ool_constant_pool_available_; | |
| 134 | |
| 135 // constant pool | |
|
rmcilroy
2014/10/09 09:22:48
/s/constant pool/Constant pool.
baixo
2014/10/09 11:21:38
Done.
| |
| 136 friend class FrameAndConstantPoolScope; | |
| 137 friend class ConstantPoolUnavailableScope; | |
| 111 }; | 138 }; |
| 112 | 139 |
| 113 | 140 |
| 114 // Avoids emitting debug code during the lifetime of this scope object. | 141 // Avoids emitting debug code during the lifetime of this scope object. |
| 115 class DontEmitDebugCodeScope BASE_EMBEDDED { | 142 class DontEmitDebugCodeScope BASE_EMBEDDED { |
| 116 public: | 143 public: |
| 117 explicit DontEmitDebugCodeScope(AssemblerBase* assembler) | 144 explicit DontEmitDebugCodeScope(AssemblerBase* assembler) |
| 118 : assembler_(assembler), old_value_(assembler->emit_debug_code()) { | 145 : assembler_(assembler), old_value_(assembler->emit_debug_code()) { |
| 119 assembler_->set_emit_debug_code(false); | 146 assembler_->set_emit_debug_code(false); |
| 120 } | 147 } |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1103 NullCallWrapper() { } | 1130 NullCallWrapper() { } |
| 1104 virtual ~NullCallWrapper() { } | 1131 virtual ~NullCallWrapper() { } |
| 1105 virtual void BeforeCall(int call_size) const { } | 1132 virtual void BeforeCall(int call_size) const { } |
| 1106 virtual void AfterCall() const { } | 1133 virtual void AfterCall() const { } |
| 1107 }; | 1134 }; |
| 1108 | 1135 |
| 1109 | 1136 |
| 1110 } } // namespace v8::internal | 1137 } } // namespace v8::internal |
| 1111 | 1138 |
| 1112 #endif // V8_ASSEMBLER_H_ | 1139 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |