Skip to content

Commit

Permalink
Merge branch 'opsc_llvm' of github.com:parrot/parrot into opsc_llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
bacek committed Mar 10, 2011
2 parents b95bd46 + 4008a6b commit b75e23b
Show file tree
Hide file tree
Showing 48 changed files with 505 additions and 2,429 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ docs/project/core_inclusion.pod [doc]
docs/project/debian_packaging_guide.pod [doc]
docs/project/git_terminology.pod [doc]
docs/project/git_workflow.pod [doc]
docs/project/hacking_tips.pod [doc]
docs/project/merge_review_guidelines.pod [doc]
docs/project/metacommitter_guide.pod [doc]
docs/project/release_manager_guide.pod [doc]
Expand Down
24 changes: 19 additions & 5 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ New in 3.2.0
+ A PMC is implemented for low-level buffer access which separate the
representation from the pointers
+ Support added for 'long double', 'long long', and 64-bit to StructView
+ In math.h are tools available for Inf/NaN
+ Signature PMCs are used pervasively
- Languages
+ A few tests in Cardinal are fixed
+ Minor fixes, refactors and cleaning on Winxed
+ New predefs replace and push on Winxed
+ Operators exits, class and .* (indirect method call) added on Winxed
+ $loadlib directive for Winxed
+ -o option to installable driver added on Winxed
+ A binary .dmg is created of Rakudo Star for OS X
+ Winxed
- Minor fixes, refactors and cleaning
- New predefs replace, push and provide a way to access multiple return
values
- Operators exits, class and .* (indirect method call) added
- $loadlib directive
- -o option to installable driver added
- Indent generated PIR is added to improve clarity and avoid imcc pitfalls
with non indented sub bodys
- Community
+ M0 roadmap is in progress
- Documentation
Expand All @@ -25,6 +32,13 @@ New in 3.2.0
+ Added 'make release_check' target so that Release Manager can double-check
tarball
+ Probes added for 'long long' and 64-bit C types
- Rosella (https://github.com/Whiteknight/Rosella)
Rosella is a collection of tools and building blocks for Parrot
+ A working proxy library is created, that make mostly-transparent custom
proxies for many types of Parrot PMCs
+ A mockobject testing library is created, using the new proxy library
+ The PLA test suite is updated to use the new Rosella testing tools,
including the new mockobjects to test callbacks

New in 3.1.0
- Core
Expand Down
4 changes: 4 additions & 0 deletions compilers/data_json/JSON.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ grammar JSON::Grammar is HLL::Grammar {
'false'
}

rule value:sym<null> {
'null'
}

token string {
<?["]> <quote_EXPR: ':qq'>
}
Expand Down
1 change: 0 additions & 1 deletion compilers/imcc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,6 @@ imcc_compile_file(PARROT_INTERP, ARGIN(STRING *fullname),
PackFile_ByteCode * const cs_save = Parrot_pf_get_current_code_segment(interp);
PackFile_ByteCode *cs = NULL;
struct _imc_info_t *imc_info = NULL;
const char *ext;
PIOHANDLE fp;
PMC *newcontext;

Expand Down
2 changes: 0 additions & 2 deletions compilers/opsc/src/Ops/Trans/C.pm
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,9 @@ static op_info_t {self.op_info($emitter)}[{self<num_entries>}] = | ~ q|{
!! '{ 0 }';

$fh.print(' { ' ~ qq|/* $index */
/* type $type, */
"$name",
"$full_name",
"$func_name",
/* "", body */
$jump,
$arg_count,
$arg_types,
Expand Down
6 changes: 3 additions & 3 deletions config/auto/gc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ sub _init {
sub runstep {
my ( $self, $conf ) = @_;

my $gc = $conf->options->get('gc') || 'gms';
my $gc = $conf->options->get('gc') || 'ms2';
$conf->debug(" ($gc) ");

my @known_gcs = qw<gms ms ms2 inf>;
Expand All @@ -71,8 +71,8 @@ sub runstep {
$self->set_result($gc);
}
else {
$conf->data->set(gc_type => 'GMS');
$self->set_result('gms');
$conf->data->set(gc_type => 'MS2');
$self->set_result('ms2');
}
$conf->data->set(gc_flag => ''); # Compatibility with parrot-3.1.0 and earlier

Expand Down
10 changes: 2 additions & 8 deletions config/gen/makefiles/root.in
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ help :
@echo " bsdlint: Code checking with bsdlint."
@echo " sunlint: Code checking with Sun Studio's sunlint."
@echo " splint: Code checking with splint."
@echo " splint-all: Splint all of Parrot, for the masochist only."
@echo " headerizer: Recreate header files for C-source files"
@echo " apilist: Show list of PARROT_API functions"
@echo " exportlist: Show list of PARROT_EXPORT functions"
Expand Down Expand Up @@ -2645,13 +2644,8 @@ SPLINTFLAGS = \
$(SPLINTFLAGS_EVALUATION) \
$(SPLINTFLAGS_TYPES) \

SPLINT_SOURCE = `echo $(O_FILES) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@`

splint-all : $(PARROT)
$(MKPATH) $(SPLINT_TMP)
$(SPLINT) $(CC_INC) "-Iinclude/pmc" "-Icompilers/ast" $(SPLINTFLAGS) \
$(SPLINT_SOURCE) \
$(SPLINT) $(CC_INC) $(SPLINTFLAGS) compilers/imcc/main.c
#SPLINT_SOURCE = `echo $(O_FILES) | $(PERL) -pe @PQ@s/\.o/\.c/g@PQ@`
SPLINT_SOURCE = `echo src/*.c`

# "splint" is the less-thorough splint target. For cage cleaning work,
# you'll probably want to specify SPLINT_SOURCE rather than work on the
Expand Down
1 change: 1 addition & 0 deletions docs/index/developer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"docs/project/core_inclusion.pod",
"docs/project/git_terminology.pod",
"docs/project/git_workflow.pod",
"docs/project/hacking_tips.pod",
"docs/project/merge_review_guidelines.pod",
"docs/project/metacommitter_guide.pod",
"docs/project/release_manager_guide.pod",
Expand Down
74 changes: 74 additions & 0 deletions docs/project/hacking_tips.pod
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Copyright (C) 2011, Parrot Foundation.

=head1 NAME

docs/project/hacking_tips.pod - A Collection of Useful Tips for Parrot Hacking

=head1 DESCRIPTION

Parrot is a complex project that can fail in mysterious and spectacular ways
and has a tendency to exhibit surprising performance bottlenecks. When that
happens, you have the exciting job of figuring out what's wrong and how to fix
it. This document exists to provide a repository of knowledge and techniques
to make that job easier.

=head2 Debugging Parrot (external tools)

=head3 gdb

gdb should be a familiar tool, but many developers only use a small subset of
its capabilities. This section covers some of its lesser known features that
may come in handy while debugging Parrot. Note that this is not intended to be
an exhaustive resource. If your favorite technique is missing, please add it.

=head4 Conditional Breakpoints

gdb's breakpoints are great for inspecting the state of a running (or recently
crashed) program, but sometimes the function or line you want to break on will
be entered many times before it becomes interesting. gdb allows breakpoints to
be tied to conditions like so:

(gdb) br Parrot_FixedPMCArray_elements if _self == 0
Breakpoint 1 at 0xb7e69830: file ./src/pmc/fixedpmcarray.c, line 163.

=head4 Pretty-Printing

A very nice feature implemented by Nolan Lum as a Google Code-In project is gdb
pretty-printing support for Parrot's STRING and PMC structs. This makes those
structs much more discoverable. Instead of seeing this:
$1 = {flags = 512, vtable = 0x8096388, data = 0x80b64a4, _metadata = 0x0}
when debugging a PMC or STRING, you'll see this:
<INSERT AWESOME GDB 7.1 OUTPUT HERE>
Note that you'll need gdb 7.1 or later for this to work.

=head2 Debugging Parrot (internal tools)

When it crashes, Parrot make an effort to provide a PIR-level backtrace in
addition the typical C-level backtrace. This may not be entirely useful
because libparrot gets its debugging information from imcc, but there's
potential for it to help.

TODO: parrot_debugger

=head2 Profiling (external tools)

TODO: valgrind (memgrind, callgrind)

=head2 Profiling (internal tools)

TODO: profiling runcore

=head2 Misc

When hacking on the Configure system, it's helpful to be able to run a single
step instead of having to go through the whole process.
tools/dev/reconfigure.pl exists for that purpose:

perl tools/dev/reconfigure.pl --step=gen::makefile

=cut

__END__
Local Variables:
fill-column:78
End:
18 changes: 9 additions & 9 deletions include/parrot/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ PARROT_PURE_FUNCTION
INTVAL Parrot_hash_size(SHIM_INTERP, ARGIN(const Hash *hash))
__attribute__nonnull__(2);

PARROT_HOT
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
size_t Parrot_hash_buffer(
ARGIN_NULLOK(const unsigned char *buf),
size_t len,
size_t hashval);

void Parrot_hash_chash_destroy(PARROT_INTERP, ARGMOD(Hash *hash))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
Expand Down Expand Up @@ -406,14 +414,6 @@ STRING* Parrot_hash_value_to_string(PARROT_INTERP,
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_HOT
PARROT_WARN_UNUSED_RESULT
PARROT_PURE_FUNCTION
size_t Parrot_hsh_hash_buffer(
ARGIN_NULLOK(const unsigned char *buf),
size_t len,
size_t hashval);

#define ASSERT_ARGS_Parrot_hash_clone __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(hash) \
Expand Down Expand Up @@ -452,6 +452,7 @@ size_t Parrot_hsh_hash_buffer(
, PARROT_ASSERT_ARG(hash))
#define ASSERT_ARGS_Parrot_hash_size __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(hash))
#define ASSERT_ARGS_Parrot_hash_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_hash_chash_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(hash))
Expand Down Expand Up @@ -520,7 +521,6 @@ size_t Parrot_hsh_hash_buffer(
#define ASSERT_ARGS_Parrot_hash_value_to_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(hash))
#define ASSERT_ARGS_Parrot_hsh_hash_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: src/hash.c */

Expand Down
8 changes: 4 additions & 4 deletions include/parrot/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,25 @@

PARROT_EXPORT
PARROT_MALLOC
PARROT_CAN_RETURN_NULL
PARROT_CANNOT_RETURN_NULL
void * mem_sys_allocate(size_t size);

PARROT_EXPORT
PARROT_MALLOC
PARROT_CAN_RETURN_NULL
PARROT_CANNOT_RETURN_NULL
void * mem_sys_allocate_zeroed(size_t size);

PARROT_EXPORT
void mem_sys_free(ARGFREE(void *from));

PARROT_EXPORT
PARROT_MALLOC
PARROT_CAN_RETURN_NULL
PARROT_CANNOT_RETURN_NULL
void * mem_sys_realloc(ARGFREE(void *from), size_t size);

PARROT_EXPORT
PARROT_MALLOC
PARROT_CAN_RETURN_NULL
PARROT_CANNOT_RETURN_NULL
void * mem_sys_realloc_zeroed(
ARGFREE(void *from),
size_t size,
Expand Down
4 changes: 2 additions & 2 deletions include/parrot/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ INTVAL Parrot_util_range_rand(INTVAL from, INTVAL to, INTVAL how_random);

PARROT_EXPORT
void Parrot_util_register_move(PARROT_INTERP,
int n_regs,
size_t n_regs,
ARGOUT(unsigned char *dest_regs),
ARGIN(unsigned char *src_regs),
unsigned char temp_reg,
Expand Down Expand Up @@ -192,7 +192,7 @@ STRING * Parrot_sprintf_s(PARROT_INTERP, ARGIN(STRING *pat), ...)

PARROT_EXPORT
void Parrot_vsnprintf(PARROT_INTERP,
ARGOUT(char *targ),
ARGMOD(char *targ),
size_t len,
ARGIN(const char *pat),
va_list args)
Expand Down
2 changes: 1 addition & 1 deletion include/parrot/namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PMC * Parrot_ns_find_current_namespace_global(PARROT_INTERP,

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
PARROT_CAN_RETURN_NULL
PMC * Parrot_ns_find_global_from_op(PARROT_INTERP,
ARGIN(PMC *ns),
ARGIN_NULLOK(STRING *globalname),
Expand Down
7 changes: 3 additions & 4 deletions include/parrot/string_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ void Parrot_str_pin(SHIM_INTERP, ARGMOD(STRING *s))
PARROT_EXPORT
PARROT_IGNORABLE_RESULT
PARROT_CAN_RETURN_NULL
const STR_VTABLE * Parrot_str_rep_compatible(PARROT_INTERP,
PARROT_PURE_FUNCTION
const STR_VTABLE * Parrot_str_rep_compatible(SHIM_INTERP,
ARGIN(const STRING *a),
ARGIN(const STRING *b))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
__attribute__nonnull__(3);

Expand Down Expand Up @@ -585,8 +585,7 @@ STRING * Parrot_str_iter_substr(PARROT_INTERP,
#define ASSERT_ARGS_Parrot_str_pin __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(s))
#define ASSERT_ARGS_Parrot_str_rep_compatible __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(a) \
PARROT_ASSERT_ARG(a) \
, PARROT_ASSERT_ARG(b))
#define ASSERT_ARGS_Parrot_str_repeat __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
Expand Down
19 changes: 6 additions & 13 deletions include/parrot/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,10 @@ VAR_SCOPE Shared_gc_info *shared_gc_info;
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

PARROT_EXPORT
void Parrot_shared_gc_block(PARROT_INTERP)
__attribute__nonnull__(1);
void Parrot_shared_gc_block(SHIM_INTERP);

PARROT_EXPORT
void Parrot_shared_gc_unblock(PARROT_INTERP)
__attribute__nonnull__(1);
void Parrot_shared_gc_unblock(SHIM_INTERP);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
Expand All @@ -142,9 +140,7 @@ void pt_clone_globals(Parrot_Interp d, Parrot_Interp s);
void pt_free_pool(PARROT_INTERP)
__attribute__nonnull__(1);

void pt_gc_mark_root_finished(PARROT_INTERP)
__attribute__nonnull__(1);

void pt_gc_mark_root_finished(SHIM_INTERP);
void pt_gc_start_mark(PARROT_INTERP)
__attribute__nonnull__(1);

Expand Down Expand Up @@ -203,10 +199,8 @@ PMC * pt_transfer_sub(
__attribute__nonnull__(3)
FUNC_MODIFIES(d);

#define ASSERT_ARGS_Parrot_shared_gc_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_shared_gc_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_shared_gc_block __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_shared_gc_unblock __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_pt_thread_create __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_pt_add_to_interpreters __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
Expand All @@ -215,8 +209,7 @@ PMC * pt_transfer_sub(
#define ASSERT_ARGS_pt_clone_globals __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_pt_free_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_pt_gc_mark_root_finished __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_pt_gc_mark_root_finished __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_pt_gc_start_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_pt_gc_stop_mark __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
Expand Down
Loading

0 comments on commit b75e23b

Please sign in to comment.