Skip to content

Commit f2f513e

Browse files
committed
Rename structs
1 parent c09da6d commit f2f513e

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

nova_vm/src/ecmascript/builtins/control_abstraction_objects/promise_objects/promise_abstract_operations/promise_all_record.rs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ use crate::{
2020
};
2121

2222
#[derive(Debug, Clone, Copy)]
23-
pub struct PromiseAllRecordHeapData<'a> {
23+
pub struct PromiseAllRecord<'a> {
2424
pub remaining_unresolved_promise_count: u32,
2525
pub result_array: Array<'a>,
2626
pub promise: Promise<'a>,
2727
}
2828

2929
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
3030
#[repr(transparent)]
31-
pub struct PromiseAllRecord<'a>(pub(crate) BaseIndex<'a, PromiseAllRecordHeapData<'a>>);
31+
pub struct PromiseAll<'a>(pub(crate) BaseIndex<'a, PromiseAllRecord<'a>>);
3232

33-
impl<'a> PromiseAllRecordHeapData<'a> {
33+
impl<'a> PromiseAllRecord<'a> {
3434
pub(crate) fn on_promise_fufilled(
3535
&mut self,
3636
agent: &mut Agent,
@@ -51,47 +51,47 @@ impl<'a> PromiseAllRecordHeapData<'a> {
5151
}
5252
}
5353

54-
impl PromiseAllRecord<'_> {
54+
impl PromiseAll<'_> {
5555
pub(crate) const fn get_index(self) -> usize {
5656
self.0.into_index()
5757
}
5858
}
5959

60-
impl Index<PromiseAllRecord<'_>> for Agent {
61-
type Output = PromiseAllRecordHeapData<'static>;
60+
impl Index<PromiseAll<'_>> for Agent {
61+
type Output = PromiseAllRecord<'static>;
6262

63-
fn index(&self, index: PromiseAllRecord) -> &Self::Output {
63+
fn index(&self, index: PromiseAll) -> &Self::Output {
6464
&self.heap.promise_all_records[index]
6565
}
6666
}
6767

68-
impl IndexMut<PromiseAllRecord<'_>> for Agent {
69-
fn index_mut(&mut self, index: PromiseAllRecord) -> &mut Self::Output {
68+
impl IndexMut<PromiseAll<'_>> for Agent {
69+
fn index_mut(&mut self, index: PromiseAll) -> &mut Self::Output {
7070
&mut self.heap.promise_all_records[index]
7171
}
7272
}
7373

74-
impl Index<PromiseAllRecord<'_>> for Vec<Option<PromiseAllRecordHeapData<'static>>> {
75-
type Output = PromiseAllRecordHeapData<'static>;
74+
impl Index<PromiseAll<'_>> for Vec<Option<PromiseAllRecord<'static>>> {
75+
type Output = PromiseAllRecord<'static>;
7676

77-
fn index(&self, index: PromiseAllRecord) -> &Self::Output {
77+
fn index(&self, index: PromiseAll) -> &Self::Output {
7878
self.get(index.get_index())
7979
.expect("PromiseAllRecord out of bounds")
8080
.as_ref()
8181
.expect("PromiseAllRecord slot empty")
8282
}
8383
}
8484

85-
impl IndexMut<PromiseAllRecord<'_>> for Vec<Option<PromiseAllRecordHeapData<'static>>> {
86-
fn index_mut(&mut self, index: PromiseAllRecord) -> &mut Self::Output {
85+
impl IndexMut<PromiseAll<'_>> for Vec<Option<PromiseAllRecord<'static>>> {
86+
fn index_mut(&mut self, index: PromiseAll) -> &mut Self::Output {
8787
self.get_mut(index.get_index())
8888
.expect("PromiseAllRecord out of bounds")
8989
.as_mut()
9090
.expect("PromiseAllRecord slot empty")
9191
}
9292
}
9393

94-
impl HeapMarkAndSweep for PromiseAllRecordHeapData<'static> {
94+
impl HeapMarkAndSweep for PromiseAllRecord<'static> {
9595
fn mark_values(&self, queues: &mut WorkQueues) {
9696
self.result_array.mark_values(queues);
9797
}
@@ -101,8 +101,8 @@ impl HeapMarkAndSweep for PromiseAllRecordHeapData<'static> {
101101
}
102102
}
103103

104-
unsafe impl Bindable for PromiseAllRecordHeapData<'_> {
105-
type Of<'a> = PromiseAllRecordHeapData<'a>;
104+
unsafe impl Bindable for PromiseAllRecord<'_> {
105+
type Of<'a> = PromiseAllRecord<'a>;
106106

107107
#[inline(always)]
108108
fn unbind(self) -> Self::Of<'static> {
@@ -115,7 +115,7 @@ unsafe impl Bindable for PromiseAllRecordHeapData<'_> {
115115
}
116116
}
117117

118-
impl HeapMarkAndSweep for PromiseAllRecord<'static> {
118+
impl HeapMarkAndSweep for PromiseAll<'static> {
119119
fn mark_values(&self, queues: &mut WorkQueues) {
120120
queues.promise_all_records.push(*self);
121121
}
@@ -125,8 +125,8 @@ impl HeapMarkAndSweep for PromiseAllRecord<'static> {
125125
}
126126
}
127127

128-
unsafe impl Bindable for PromiseAllRecord<'_> {
129-
type Of<'a> = PromiseAllRecord<'a>;
128+
unsafe impl Bindable for PromiseAll<'_> {
129+
type Of<'a> = PromiseAll<'a>;
130130

131131
#[inline(always)]
132132
fn unbind(self) -> Self::Of<'static> {
@@ -139,10 +139,10 @@ unsafe impl Bindable for PromiseAllRecord<'_> {
139139
}
140140
}
141141

142-
impl<'a> CreateHeapData<PromiseAllRecordHeapData<'a>, PromiseAllRecord<'a>> for Heap {
143-
fn create(&mut self, data: PromiseAllRecordHeapData<'a>) -> PromiseAllRecord<'a> {
142+
impl<'a> CreateHeapData<PromiseAllRecord<'a>, PromiseAll<'a>> for Heap {
143+
fn create(&mut self, data: PromiseAllRecord<'a>) -> PromiseAll<'a> {
144144
self.promise_all_records.push(Some(data.unbind()));
145-
self.alloc_counter += core::mem::size_of::<Option<PromiseAllRecordHeapData<'static>>>();
146-
PromiseAllRecord(BaseIndex::last(&self.promise_all_records))
145+
self.alloc_counter += core::mem::size_of::<Option<PromiseAllRecord<'static>>>();
146+
PromiseAll(BaseIndex::last(&self.promise_all_records))
147147
}
148148
}

nova_vm/src/ecmascript/builtins/control_abstraction_objects/promise_objects/promise_abstract_operations/promise_reaction_records.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::{
1010
async_generator_objects::AsyncGenerator,
1111
control_abstraction_objects::async_function_objects::await_reaction::AwaitReaction,
1212
promise::Promise,
13-
promise_objects::promise_abstract_operations::promise_all_record::PromiseAllRecord,
13+
promise_objects::promise_abstract_operations::promise_all_record::PromiseAll,
1414
},
1515
execution::Agent,
1616
scripts_and_modules::module::module_semantics::{
@@ -71,7 +71,7 @@ pub(crate) enum PromiseReactionHandler<'a> {
7171
},
7272
PromiseAll {
7373
index: u32,
74-
promise_all: PromiseAllRecord<'a>,
74+
promise_all: PromiseAll<'a>,
7575
},
7676
Empty,
7777
}

nova_vm/src/ecmascript/builtins/control_abstraction_objects/promise_objects/promise_constructor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// License, v. 2.0. If a copy of the MPL was not distributed with this
33
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5-
use crate::ecmascript::builtins::promise_objects::promise_abstract_operations::promise_all_record::PromiseAllRecordHeapData;
5+
use crate::ecmascript::builtins::promise_objects::promise_abstract_operations::promise_all_record::PromiseAllRecord;
66
use crate::ecmascript::builtins::promise_objects::promise_abstract_operations::promise_reaction_records::PromiseReactionHandler;
77
use crate::ecmascript::builtins::promise_objects::promise_prototype::inner_promise_then;
88
use crate::ecmascript::builtins::Array;
@@ -328,7 +328,7 @@ impl PromiseConstructor {
328328
let undefined_values = (vec![Value::Undefined.bind(gc.nogc()); 2]).bind(gc.nogc());
329329
let result_array =
330330
Array::from_slice(agent, &undefined_values.unbind(), gc.nogc()).bind(gc.nogc());
331-
let promise_all_record = agent.heap.create(PromiseAllRecordHeapData {
331+
let promise_all_record = agent.heap.create(PromiseAllRecord {
332332
remaining_unresolved_promise_count: 2,
333333
result_array: result_array.unbind(),
334334
promise: result_promise.unbind(),

nova_vm/src/heap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ use crate::{
8080
},
8181
primitive_objects::PrimitiveObjectHeapData,
8282
promise::data::PromiseHeapData,
83-
promise_objects::promise_abstract_operations::promise_all_record::PromiseAllRecordHeapData,
83+
promise_objects::promise_abstract_operations::promise_all_record::PromiseAllRecord,
8484
proxy::data::ProxyHeapData,
8585
text_processing::string_objects::string_iterator_objects::StringIteratorHeapData,
8686
},
@@ -169,7 +169,7 @@ pub struct Heap {
169169
pub promise_reaction_records: Vec<Option<PromiseReactionRecord<'static>>>,
170170
pub promise_resolving_functions: Vec<Option<PromiseResolvingFunctionHeapData<'static>>>,
171171
pub promises: Vec<Option<PromiseHeapData<'static>>>,
172-
pub promise_all_records: Vec<Option<PromiseAllRecordHeapData<'static>>>,
172+
pub promise_all_records: Vec<Option<PromiseAllRecord<'static>>>,
173173
pub proxys: Vec<Option<ProxyHeapData<'static>>>,
174174
pub realms: Vec<Option<RealmRecord<'static>>>,
175175
#[cfg(feature = "regexp")]

nova_vm/src/heap/heap_bits.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use crate::ecmascript::{
5050
ordinary::{caches::PropertyLookupCache, shape::ObjectShape},
5151
primitive_objects::PrimitiveObject,
5252
promise::Promise,
53-
promise_objects::promise_abstract_operations::promise_all_record::PromiseAllRecord,
53+
promise_objects::promise_abstract_operations::promise_all_record::PromiseAll,
5454
proxy::Proxy,
5555
text_processing::string_objects::string_iterator_objects::StringIterator,
5656
},
@@ -210,7 +210,7 @@ pub(crate) struct WorkQueues {
210210
pub promises: Vec<Promise<'static>>,
211211
pub promise_reaction_records: Vec<PromiseReaction<'static>>,
212212
pub promise_resolving_functions: Vec<BuiltinPromiseResolvingFunction<'static>>,
213-
pub promise_all_records: Vec<PromiseAllRecord<'static>>,
213+
pub promise_all_records: Vec<PromiseAll<'static>>,
214214
pub proxys: Vec<Proxy<'static>>,
215215
pub realms: Vec<Realm<'static>>,
216216
#[cfg(feature = "regexp")]

0 commit comments

Comments
 (0)