Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion NULL Px proposal (was Re: [BUG] IMCC looking in P3[0] for 1st arg)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Melvin Smith  
View profile  
 More options Oct 26 2003, 1:48 pm
Newsgroups: perl.perl6.internals
From: mrjoltc...@mindspring.com (Melvin Smith)
Date: Sun, 26 Oct 2003 13:39:24 -0500
Local: Sun, Oct 26 2003 1:39 pm
Subject: NULL Px proposal (was Re: [BUG] IMCC looking in P3[0] for 1st arg)
At 07:21 PM 10/26/2003 +0100, Leopold Toetsch wrote:

>Steve Fink <st...@fink.com> wrote:

> > Although this does bring up another issue -- should parrot really be
> > seg faulting when it gets a uninitialized (null) PMC?

>The problem is of course that we call pmc->vtable->some_meth_od() on a
>NULL PMC. We could do the checks always, slowing down each PMC
>operation. But OTOH a correct HLL compiler wouldn't produce such broken
>code (hopefully). So that's probably something for the bounds-checking

This is an old discussion. While I agree with Leo (and Dan) on not putting
checks everywhere, I also think segfaulting on faulty bytecode is
violating the "Virtual Machine" contract.

I also don't wan't to see the performance hit of checking PMC regs everywhere.

I think a compromise would be to do define a interpreter global PMCNull
and point (or init) all Px registers to it.

All methods in this class would be implemented to throw an exception or
dump the bytecode for debugging and we could always trap a "NULL"
register access.

This way we never have a NULL pointer access with regards to Px regs.

The downside is fast initialization of register blocks. memsetting with
NULL (0)
will not be possible, but I'd have to actually go check and see if that
is really all that common.

-Melvin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.