Ticket #1549 (closed deprecation: fixed)

Opened 5 years ago

Last modified 4 years ago

[DEPRECTION] NCI for "raw" pointers

Reported by: plobsing Owned by:
Priority: normal Milestone:
Component: none Version: 2.2.0
Severity: medium Keywords:
Cc: mikehh, NotFound Language:
Patch status: Platform:

Description

NCI "raw" pointers use NCI without providing a signature. This was used at one time for methods. This is no longer the case, and this functionality is now completely broken.

The raw pointer interface includes:

  • set_raw_nci_ptr
  • make_raw_nci
  • set_pointer (use set_pointer_keyed_str in stead)

Attachments

native_pcc_method.patch Download (13.9 KB) - added by plobsing 5 years ago.

Change History

Changed 5 years ago by plobsing

  Changed 5 years ago by plobsing

I've added a patch that adds a type, NativePCCMethod, to provide for the major use case of the NCI raw interface - native PMC methods which handle their own PCC.

I'll hold off on applying this until after Tuesday's release.

  Changed 4 years ago by plobsing

  • status changed from new to closed
  • resolution set to fixed

This functionality has been removed in r48793.

  Changed 4 years ago by jkeenan

  • cc mikehh, NotFound added
  • status changed from closed to reopened
  • resolution fixed deleted

We're getting a test failure that appears to be related to the series of commits (roughly, r48789 to r48794) in which this deprecation item was implemented.

#   Failed test 'examples/namespace/namespace_dump.pir'
#   at t/examples/namespace.t line 46.
# Exited with error code: 1
# Received:
# MULTI => MULTI
#     is_equal =>  Multi [
#                                                                                                                                             ]
#     divide =>  Multi [
#                                                                                             ]
#     cmp_string =>  Multi [
#             ]
#     floor_divide =>  Multi [
#                                                                             ]
#     get_or_create_constant =>  Multi [
#                             ]
#     i_divide =>  Multi [
#                                                                                             ]
#     i_floor_divide =>  Multi [
#                                                                     ]
#     cmp =>  Multi [
#                                                                                             ]
#     multiply =>  Multi [
#                                                                                                                             ]
#     is_equal_num =>  Multi [
#                             ]
#     subtract =>  Multi [
#                                                                                                                     ]
#     i_multiply =>  Multi [
#                                                                                                                             ]
#     is_equal_string =>  Multi [
#             ]
#     add =>  Multi [
#                                                                                                                     ]
#     modulus =>  Multi [
#                                                     ]
#     cmp_num =>  Multi [
#                                                     ]
#     i_subtract =>  Multi [
#                                                                                                                     ]
#     i_add =>  Multi [
#                                                                                                                     ]
#     i_modulus =>  Multi [
#                                             ]
# parrot => parrot
#     Capture => Capture
#         hash => get_string() not implemented in class 'NativePCCMethod'
# current instr.: 'dump' pc 120 (/home/jimk/work/parrot/t/examples/namespace_1.pir:57)
# called from Sub 'dump' pc 144 (/home/jimk/work/parrot/t/examples/namespace_1.pir:62)
# ... call repeated 1 times
# called from Sub 'main' pc 11 (/home/jimk/work/parrot/t/examples/namespace_1.pir:12)
# 
# Expected:
# /(?:^parrot.*
# ^MULTI\s=>\sMULTI)|(?:^MULTI\s=>\sMULTI.*
# ^parrot.*)/sm
# 
# Looks like you failed 1 test of 1.
t/examples/namespace.t .. 
1..1
not ok 1 - examples/namespace/namespace_dump.pir
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/examples/namespace.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=1,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.07 cusr  0.01 csys =  0.11 CPU)
Result: FAIL

Now, it may very well be that the original test is now too crude to test this area adequately. t/examples/namespace.t contains this inline comment:

# cannot test the exact result, just adding one method somewhere
# changes all. Also namespaces are hashes.  And we do not gurantee any specific
# order of keys.  test the name of the 2 toplevel names,  parrot is using

So, we may need only to update the test file. Nonetheless, we have to reopen this ticket.

Thank you very much.

kid51

  Changed 4 years ago by NotFound

Looks like the example program expects that almost anything in a namespace has a usable get_string vtable. I'm not sure if this is a reasonable assumption. If it is, NativePCCMethod must provide it.

Also, it explains poorly what it does, and using a lot of unnamed registers doesn't help. Code in examples should be more clear, IMO.

follow-up: ↓ 6   Changed 4 years ago by mikehh

As I understand it the test t/examples/namespace.t just tests for the valid output of examples/namespace/namespace_dump.pir (in fact it was set up to test all examples in namespace dir, but there is only the one).

The test merely reflects the output of the example:

mhb@mhb-desktop:~/parrot$ date
Mon Sep  6 17:58:29 BST 2010
mhb@mhb-desktop:~/parrot$ ./parrot examples/namespace/namespace_dump.pir 
MULTI => MULTI
    get_or_create_constant =>  Multi [
                            ]
    i_divide =>  Multi [
                                                                                            ]
    i_floor_divide =>  Multi [
                                                                    ]
    cmp =>  Multi [
                                                                                            ]
    multiply =>  Multi [
                                                                                                                            ]
    is_equal_num =>  Multi [
                            ]
    subtract =>  Multi [
                                                                                                                    ]
    i_multiply =>  Multi [
                                                                                                                            ]
    is_equal_string =>  Multi [
            ]
    modulus =>  Multi [
                                                    ]
    add =>  Multi [
                                                                                                                    ]
    cmp_num =>  Multi [
                                                    ]
    i_subtract =>  Multi [
                                                                                                                    ]
    i_add =>  Multi [
                                                                                                                    ]
    i_modulus =>  Multi [
                                            ]
    is_equal =>  Multi [
                                                                                                                                            ]
    divide =>  Multi [
                                                                                            ]
    cmp_string =>  Multi [
            ]
    floor_divide =>  Multi [                                                                                                                                                                                                               
                                                                            ]                                                                                                                                                              
parrot => parrot                                                                                                                                                                                                                           
    PackfileRawSegment => PackfileRawSegment                                                                                                                                                                                               
        type => get_string() not implemented in class 'NativePCCMethod'                                                                                                                                                                    
current instr.: 'dump' pc 120 (examples/namespace/namespace_dump.pir:57)                                                                                                                                                                   
called from Sub 'dump' pc 144 (examples/namespace/namespace_dump.pir:62)                                                                                                                                                                   
... call repeated 1 times                                                                                                                                                                                                                  
called from Sub 'main' pc 11 (examples/namespace/namespace_dump.pir:12)                                                                                                                                                                    

As the example is failing with get_string() not implemented in class 'NativePCCMethod'

We either need to implement the get_string() method in the class, or modify the example appropriately before working on fixing the test.

Cheers, Michael (mikehh)

in reply to: ↑ 5   Changed 4 years ago by plobsing

  • status changed from reopened to closed
  • resolution set to fixed

Replying to mikehh:

We either need to implement the get_string() method in the class, or modify the example appropriately before working on fixing the test. Cheers, Michael (mikehh)

I've opted to modify the example. This should be fixed in r48812.

Note: See TracTickets for help on using tickets.