Flutter Engine
The Flutter Engine
weak_code.h
Go to the documentation of this file.
1// Copyright (c) 2014, 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#ifndef RUNTIME_VM_HEAP_WEAK_CODE_H_
6#define RUNTIME_VM_HEAP_WEAK_CODE_H_
7
8#include "vm/allocation.h"
9#include "vm/globals.h"
10
11namespace dart {
12
13class WeakArray;
14class Code;
15
16// Helper class to handle an array of code weak properties. Implements
17// registration and disabling of stored code objects.
19 public:
20 explicit WeakCodeReferences(const WeakArray& value) : array_(value) {}
22
23 void Register(const Code& value);
24
25 virtual void UpdateArrayTo(const WeakArray& array) = 0;
26 virtual void ReportDeoptimization(const Code& code) = 0;
27 virtual void ReportSwitchingCode(const Code& code) = 0;
28
29 void DisableCode(bool are_mutators_stopped);
30
31 bool HasCodes() const;
32
33 private:
34 const WeakArray& array_; // Array of Code objects.
35 DISALLOW_COPY_AND_ASSIGN(WeakCodeReferences);
36};
37
38} // namespace dart
39
40#endif // RUNTIME_VM_HEAP_WEAK_CODE_H_
void DisableCode(bool are_mutators_stopped)
Definition: weak_code.cc:40
virtual void ReportDeoptimization(const Code &code)=0
virtual void UpdateArrayTo(const WeakArray &array)=0
virtual ~WeakCodeReferences()
Definition: weak_code.h:21
virtual void ReportSwitchingCode(const Code &code)=0
WeakCodeReferences(const WeakArray &value)
Definition: weak_code.h:20
void Register(const Code &value)
Definition: weak_code.cc:33
bool HasCodes() const
Definition: weak_code.cc:29
uint8_t value
Definition: dart_vm.cc:33