-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mono] Use dn_vector_t instead of GArray in a few places #84027
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
5f0bb98
Use dn_vector_t instead of GArray in one place in Mono
lambdageek a991249
include shared containers in mono shared lib, too
lambdageek 87f5d50
convert mono_seq_point_init_next to use dn_vector_t
lambdageek e8c7dea
[custom-attrs] Use init/dispose instead of alloc/free for dn_vector_t
lambdageek 2c5c00a
move container logic to toplevel; add deps to runtime components
lambdageek 301c2a4
fix windows build
lambdageek ec1bf21
fix Darwin frameworks builds
lambdageek 473df84
replace 2 uses of GArray in interp/transform.c
lambdageek 5e4b453
replace a use of GArray in mini/seq-points.c
lambdageek 6029c33
replace use of GArray for debug-mini
lambdageek 0082829
WIP: start a dn_checkfail helper like g_assertf
lambdageek 1cf3d19
remove some unused assignments from eventpipe.cmake fragment
lambdageek e5d2108
make containers a normal sub-project for Mono
lambdageek adcb5a6
Add mono implementation of dn-rt.h
lambdageek 0eb1fd5
check dn_vector_alloc_t result
lambdageek 15d11fd
fix coreclr build
lambdageek 71fb5c2
add placeholder dn_rt functions for coreclr and nativeaot
lambdageek fa05fbf
fix mono build
lambdageek 695575f
maybe fix coreclr/nativeaot windows build?
lambdageek c4a28a5
move nativeaot shims to a separate file
lambdageek e0526c1
fix coreclr windows?
lambdageek 7fc5ecc
add typed dn_vector_ptr accessor macros
lambdageek e93efdc
Use dn_vector_ptr in a few places instead of dn_vector
lambdageek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#include "common.h" | ||
#include "gcenv.base.h" | ||
#include "CommonTypes.h" | ||
#include "CommonMacros.h" | ||
#include "PalRedhawkCommon.h" | ||
#include "PalRedhawk.h" | ||
#include "rhassert.h" | ||
|
||
#include "containers/dn-rt.h" | ||
|
||
DN_NORETURN void | ||
dn_rt_aot_failfast_msgv (const char* fmt, va_list ap) | ||
{ | ||
RhFailFast(); | ||
UNREACHABLE(); | ||
} | ||
|
||
DN_NORETURN void | ||
dn_rt_aot_failfast_nomsg(const char* file, int line) | ||
{ | ||
RhFailFast(); | ||
UNREACHABLE(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#ifndef __DN_RT_AOT_H__ | ||
#define __DN_RT_AOT_H__ | ||
|
||
DN_NORETURN void | ||
dn_rt_aot_failfast_msgv(const char* fmt, va_list ap); | ||
|
||
DN_NORETURN static inline void | ||
dn_rt_failfast_msgv(const char* fmt, va_list ap) | ||
{ | ||
dn_rt_aot_failfast_msgv(fmt, ap); | ||
} | ||
|
||
DN_NORETURN void | ||
dn_rt_aot_failfast_nomsg(const char* file, int line); | ||
|
||
DN_NORETURN static inline void | ||
dn_rt_failfast_nomsg(const char* file, int line) | ||
{ | ||
dn_rt_aot_failfast_nomsg(file, line); | ||
} | ||
|
||
#endif /* __DN_RT_AOT_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ project(mono) | |
|
||
set(subdirs | ||
eglib | ||
containers | ||
utils | ||
sgen | ||
metadata | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
project(containers C) | ||
|
||
### Paths and Targets for Shared Containers | ||
set(SHARED_CONTAINERS_SOURCE_PATH "${CLR_SRC_NATIVE_DIR}/containers/") | ||
include (${SHARED_CONTAINERS_SOURCE_PATH}containers.cmake) | ||
|
||
set(shared_container_sources "") | ||
|
||
list(APPEND shared_container_sources | ||
${SHARED_CONTAINER_SOURCES} | ||
${SHARED_CONTAINER_HEADERS} | ||
) | ||
|
||
addprefix(shared_container_sources ${SHARED_CONTAINERS_SOURCE_PATH} "${shared_container_sources}") | ||
|
||
set(rt_mono_container_sources | ||
dn-rt-mono.h | ||
dn-rt-utils.c) | ||
|
||
add_library(shared_container_objects OBJECT ${shared_container_sources} ${rt_mono_container_sources}) | ||
target_link_libraries(shared_container_objects PRIVATE eglib_api) | ||
target_include_directories(shared_container_objects PUBLIC ${SHARED_CONTAINERS_SOURCE_PATH} .) | ||
# to pick up config.h | ||
target_include_directories(shared_container_objects PRIVATE | ||
${PROJECT_BINARY_DIR}/../..) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#ifndef __DN_RT_MONO_H__ | ||
#define __DN_RT_MONO_H__ | ||
|
||
#include <dn-rt.h> | ||
|
||
DN_NORETURN void | ||
dn_rt_mono_failfast_msgv (const char* fmt, va_list ap); | ||
|
||
DN_NORETURN void | ||
dn_rt_mono_failfast_nomsg (const char* file, int line); | ||
|
||
DN_NORETURN static inline void | ||
dn_rt_failfast_msgv(const char* fmt, va_list ap) | ||
{ | ||
dn_rt_mono_failfast_msgv (fmt, ap); | ||
} | ||
|
||
DN_NORETURN static inline void | ||
dn_rt_failfast_nomsg(const char* fmt, int line) | ||
{ | ||
dn_rt_mono_failfast_nomsg(fmt, line); | ||
} | ||
|
||
#endif /* __DN_RT_MONO_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#include <config.h> | ||
#include <glib.h> | ||
#include <dn-rt-mono.h> | ||
|
||
void | ||
dn_rt_mono_failfast_msgv (const char *format, va_list ap) | ||
{ | ||
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, ap); | ||
g_assert_not_reached (); | ||
} | ||
|
||
void | ||
dn_rt_mono_failfast_nomsg (const char *file, int line) | ||
{ | ||
mono_assertion_message_disabled (file, line); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
*/ | ||
|
||
#include "seq-points-data.h" | ||
#include <dn-vector.h> | ||
|
||
typedef struct { | ||
guint8 *data; | ||
|
@@ -274,24 +275,27 @@ mono_seq_point_init_next (MonoSeqPointInfo* info, SeqPoint sp, SeqPoint* next) | |
int i; | ||
guint8* ptr; | ||
SeqPointIterator it; | ||
GArray* seq_points = g_array_new (FALSE, TRUE, sizeof (SeqPoint)); | ||
dn_vector_t seq_points = {0,}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to init the dn_vector_t, it will be memset by dn_vector_init_t. |
||
|
||
dn_vector_init_t (&seq_points, SeqPoint); | ||
|
||
SeqPointInfoInflated info_inflated = seq_point_info_inflate (info); | ||
|
||
g_assert (info_inflated.has_debug_data); | ||
|
||
mono_seq_point_iterator_init (&it, info); | ||
while (mono_seq_point_iterator_next (&it)) | ||
g_array_append_vals (seq_points, &it.seq_point, 1); | ||
dn_vector_push_back (&seq_points, it.seq_point); | ||
|
||
ptr = info_inflated.data + sp.next_offset; | ||
for (i = 0; i < sp.next_len; i++) { | ||
int next_index; | ||
next_index = decode_var_int (ptr, &ptr); | ||
g_assert (next_index < seq_points->len); | ||
memcpy (&next[i], seq_points->data + next_index * sizeof (SeqPoint), sizeof (SeqPoint)); | ||
g_assert (next_index < GUINT_TO_INT (dn_vector_size (&seq_points))); | ||
memcpy (&next[i], dn_vector_index_t (&seq_points, SeqPoint, next_index), sizeof (SeqPoint)); | ||
} | ||
|
||
g_array_free (seq_points, TRUE); | ||
dn_vector_dispose (&seq_points); | ||
} | ||
|
||
gboolean | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the naming of this file follow the naming of the header, dn-rt-mono.c?