Flutter Engine
The Flutter Engine
cpu_x64.cc
Go to the documentation of this file.
1// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#include "vm/globals.h"
6#if defined(TARGET_ARCH_X64)
7
8#include "vm/cpu.h"
9#include "vm/cpu_x64.h"
10
11#include "vm/cpuinfo.h"
12
13namespace dart {
14
15DEFINE_FLAG(bool, use_sse41, true, "Use SSE 4.1 if available");
16
17void CPU::FlushICache(uword start, uword size) {
18 // Nothing to be done here.
19}
20
21const char* CPU::Id() {
22 return
23#if defined(USING_SIMULATOR)
24 "sim"
25#endif // !defined(USING_SIMULATOR)
26 "x64";
27}
28
29const char* HostCPUFeatures::hardware_ = nullptr;
30bool HostCPUFeatures::sse2_supported_ = true;
31bool HostCPUFeatures::sse4_1_supported_ = false;
32bool HostCPUFeatures::popcnt_supported_ = false;
33bool HostCPUFeatures::abm_supported_ = false;
34
35#if defined(DEBUG)
36bool HostCPUFeatures::initialized_ = false;
37#endif
38
39#if !defined(USING_SIMULATOR)
42 hardware_ = CpuInfo::GetCpuModel();
43 sse4_1_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "sse4_1") ||
45 popcnt_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "popcnt");
46 abm_supported_ = CpuInfo::FieldContains(kCpuInfoFeatures, "abm");
47#if defined(DEBUG)
48 initialized_ = true;
49#endif
50}
51
53 DEBUG_ASSERT(initialized_);
54#if defined(DEBUG)
55 initialized_ = false;
56#endif
57 ASSERT(hardware_ != nullptr);
58 free(const_cast<char*>(hardware_));
59 hardware_ = nullptr;
61}
62
63#else // !defined(USING_SIMULATOR)
64
67 hardware_ = CpuInfo::GetCpuModel();
68 sse4_1_supported_ = false;
69 popcnt_supported_ = false;
70 abm_supported_ = false;
71#if defined(DEBUG)
72 initialized_ = true;
73#endif
74}
75
77 DEBUG_ASSERT(initialized_);
78#if defined(DEBUG)
79 initialized_ = false;
80#endif
81 ASSERT(hardware_ != nullptr);
82 free(const_cast<char*>(hardware_));
83 hardware_ = nullptr;
85}
86#endif // !defined(USING_SIMULATOR)
87
88} // namespace dart
89
90#endif // defined TARGET_ARCH_X64
#define DEBUG_ASSERT(cond)
Definition: assert.h:321
static const char * Id()
static void FlushICache(uword start, uword size)
static void Init()
static const char * GetCpuModel()
Definition: cpuinfo.h:59
static void Cleanup()
static bool FieldContains(CpuInfoIndices idx, const char *search_string)
static void Init()
static void Cleanup()
#define ASSERT(E)
Definition: dart_vm.cc:33
@ kCpuInfoFeatures
Definition: cpuinfo.h:19
uintptr_t uword
Definition: globals.h:501
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259