Flutter Engine
The Flutter Engine
third_party
dart-lang
sdk
runtime
vm
instructions.cc
Go to the documentation of this file.
1
// Copyright (c) 2022, 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/instructions.h
"
6
7
#include "
vm/object.h
"
8
#if defined(DART_PRECOMPILER)
9
#include "
vm/compiler/aot/precompiler.h
"
10
#endif
11
12
namespace
dart
{
13
14
bool
ObjectAtPoolIndex
(
const
Code
&
code
, intptr_t index,
Object
* obj) {
15
#if defined(DART_PRECOMPILER)
16
if
(FLAG_precompiled_mode) {
17
Precompiler
* precompiler =
Precompiler::Instance
();
18
if
(precompiler !=
nullptr
) {
19
compiler::ObjectPoolBuilder
*
pool
=
20
precompiler->
global_object_pool_builder
();
21
if
(index < pool->CurrentLength()) {
22
compiler::ObjectPoolBuilderEntry
& entry =
pool
->EntryAt(index);
23
if
(entry.
type
() ==
compiler::ObjectPoolBuilderEntry::kTaggedObject
) {
24
*obj = entry.
obj_
->
ptr
();
25
return
true
;
26
}
27
}
28
}
29
return
false
;
30
}
31
#endif
32
const
ObjectPool
&
pool
=
ObjectPool::Handle
(
code
.GetObjectPool());
33
if
(!
pool
.IsNull() && (index <
pool
.Length()) &&
34
(
pool
.TypeAt(index) == ObjectPool::EntryType::kTaggedObject)) {
35
*obj =
pool
.ObjectAt(index);
36
return
true
;
37
}
38
return
false
;
39
}
40
41
}
// namespace dart
pool
AutoreleasePool pool
Definition:
BazelBenchmarkTestRunner.cpp:313
dart::Code
Definition:
object.h:6761
dart::ObjectPool
Definition:
object.h:5550
dart::Object
Definition:
object.h:315
dart::Object::ptr
ObjectPtr ptr() const
Definition:
object.h:332
dart::Object::Handle
static Object & Handle()
Definition:
object.h:407
dart::Precompiler
Definition:
precompiler.h:242
dart::Precompiler::Instance
static Precompiler * Instance()
Definition:
precompiler.h:264
dart::Precompiler::global_object_pool_builder
compiler::ObjectPoolBuilder * global_object_pool_builder()
Definition:
precompiler.h:256
dart::compiler::ObjectPoolBuilder
Definition:
object_pool_builder.h:193
instructions.h
dart
Definition:
dart_vm.cc:33
dart::ObjectAtPoolIndex
bool ObjectAtPoolIndex(const Code &code, intptr_t index, Object *obj)
Definition:
instructions.cc:14
valgrind.code
code
Definition:
valgrind.py:29
object.h
precompiler.h
dart::compiler::ObjectPoolBuilderEntry
Definition:
object_pool_builder.h:23
dart::compiler::ObjectPoolBuilderEntry::kTaggedObject
@ kTaggedObject
Definition:
object_pool_builder.h:54
dart::compiler::ObjectPoolBuilderEntry::obj_
const Object * obj_
Definition:
object_pool_builder.h:121
dart::compiler::ObjectPoolBuilderEntry::type
EntryType type() const
Definition:
object_pool_builder.h:112
Generated on Sun Jun 23 2024 21:55:42 for Flutter Engine by
1.9.4