| Index: src/a64/cpu-a64.h
|
| diff --git a/src/typing.h b/src/a64/cpu-a64.h
|
| similarity index 54%
|
| copy from src/typing.h
|
| copy to src/a64/cpu-a64.h
|
| index d8708c2ccbe6f456ff76bdb53d7d530e4ced405e..fd5cf2ceaa7168532ccf2810c100a593b397876e 100644
|
| --- a/src/typing.h
|
| +++ b/src/a64/cpu-a64.h
|
| @@ -25,53 +25,64 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -#ifndef V8_TYPING_H_
|
| -#define V8_TYPING_H_
|
| +#ifndef V8_A64_CPU_A64_H_
|
| +#define V8_A64_CPU_A64_H_
|
|
|
| -#include "v8.h"
|
| -
|
| -#include "allocation.h"
|
| -#include "ast.h"
|
| -#include "compiler.h"
|
| -#include "type-info.h"
|
| -#include "zone.h"
|
| -#include "scopes.h"
|
| +#include <stdio.h>
|
| +#include "serialize.h"
|
| +#include "cpu.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
|
|
|
|
| -class AstTyper: public AstVisitor {
|
| +// CpuFeatures keeps track of which features are supported by the target CPU.
|
| +// Supported features must be enabled by a CpuFeatureScope before use.
|
| +class CpuFeatures : public AllStatic {
|
| public:
|
| - static void Type(CompilationInfo* info);
|
| + // Detect features of the target CPU. Set safe defaults if the serializer
|
| + // is enabled (snapshots must be portable).
|
| + static void Probe();
|
| +
|
| + // Check whether a feature is supported by the target CPU.
|
| + static bool IsSupported(CpuFeature f) {
|
| + ASSERT(initialized_);
|
| + // There are no optional features for A64.
|
| + return false;
|
| + };
|
| +
|
| + static bool IsFoundByRuntimeProbingOnly(CpuFeature f) {
|
| + ASSERT(initialized_);
|
| + // There are no optional features for A64.
|
| + return false;
|
| + }
|
|
|
| - void* operator new(size_t size, Zone* zone) {
|
| - return zone->New(static_cast<int>(size));
|
| + static bool IsSafeForSnapshot(CpuFeature f) {
|
| + return (IsSupported(f) &&
|
| + (!Serializer::enabled() || !IsFoundByRuntimeProbingOnly(f)));
|
| }
|
| - void operator delete(void* pointer, Zone* zone) { }
|
| - void operator delete(void* pointer) { }
|
|
|
| - DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
|
| + // I and D cache line size in bytes.
|
| + static unsigned dcache_line_size();
|
| + static unsigned icache_line_size();
|
|
|
| - private:
|
| - explicit AstTyper(CompilationInfo* info);
|
| + static unsigned supported_;
|
|
|
| - CompilationInfo* info_;
|
| - TypeFeedbackOracle oracle_;
|
| -
|
| - TypeFeedbackOracle* oracle() { return &oracle_; }
|
| - Zone* zone() const { return info_->zone(); }
|
| + private:
|
| + // Return the content of the cache type register.
|
| + static uint32_t GetCacheType();
|
|
|
| - void VisitDeclarations(ZoneList<Declaration*>* declarations);
|
| - void VisitStatements(ZoneList<Statement*>* statements);
|
| + // I and D cache line size in bytes.
|
| + static unsigned icache_line_size_;
|
| + static unsigned dcache_line_size_;
|
|
|
| -#define DECLARE_VISIT(type) virtual void Visit##type(type* node);
|
| - AST_NODE_LIST(DECLARE_VISIT)
|
| -#undef DECLARE_VISIT
|
| +#ifdef DEBUG
|
| + static bool initialized_;
|
| +#endif
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(AstTyper);
|
| + DISALLOW_COPY_AND_ASSIGN(CpuFeatures);
|
| };
|
|
|
| } } // namespace v8::internal
|
|
|
| -#endif // V8_TYPING_H_
|
| +#endif // V8_A64_CPU_A64_H_
|
|
|