[svn:parrot] r48340 - in branches/unshared_buffers: . compilers/pct/src/PAST include/parrot src src/call src/interp src/pmc src/runcore t/native_pbc t/pmc t/src tools/dev

darbelo at svn.parrot.org darbelo at svn.parrot.org
Sat Aug 7 01:10:12 UTC 2010


Author: darbelo
Date: Sat Aug  7 01:10:11 2010
New Revision: 48340
URL: https://trac.parrot.org/parrot/changeset/48340

Log:
Sync with trunk.

Modified:
   branches/unshared_buffers/   (props changed)
   branches/unshared_buffers/compilers/pct/src/PAST/Compiler.pir
   branches/unshared_buffers/include/parrot/hash.h
   branches/unshared_buffers/include/parrot/runcore_trace.h   (props changed)
   branches/unshared_buffers/src/call/args.c
   branches/unshared_buffers/src/hash.c
   branches/unshared_buffers/src/interp/inter_create.c   (props changed)
   branches/unshared_buffers/src/pmc.c
   branches/unshared_buffers/src/pmc/callcontext.pmc
   branches/unshared_buffers/src/pmc/default.pmc
   branches/unshared_buffers/src/pmc/env.pmc
   branches/unshared_buffers/src/runcore/cores.c   (props changed)
   branches/unshared_buffers/src/runcore/trace.c   (props changed)
   branches/unshared_buffers/t/native_pbc/annotations.pbc
   branches/unshared_buffers/t/native_pbc/integer.pbc
   branches/unshared_buffers/t/native_pbc/number.pbc
   branches/unshared_buffers/t/native_pbc/string.pbc
   branches/unshared_buffers/t/pmc/oplib.t
   branches/unshared_buffers/t/src/embed.t   (props changed)
   branches/unshared_buffers/tools/dev/mk_gitignore.pl   (props changed)

Modified: branches/unshared_buffers/compilers/pct/src/PAST/Compiler.pir
==============================================================================
--- branches/unshared_buffers/compilers/pct/src/PAST/Compiler.pir	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/compilers/pct/src/PAST/Compiler.pir	Sat Aug  7 01:10:11 2010	(r48340)
@@ -81,7 +81,11 @@
     piropsig['find_codepoint']   = 'Is'
     piropsig['find_dynamic_lex'] = 'Ps'
     piropsig['find_name']  = 'Ps'
+    piropsig['getinterp']  = 'P'
     piropsig['getprop']    = 'P~P'
+    piropsig['getstderr']  = 'P'
+    piropsig['getstdin']   = 'P'
+    piropsig['getstdout']  = 'P'
     piropsig['index']      = 'Issi'
     piropsig['isa']        = 'IP~'
     piropsig['isfalse']    = 'IP'
@@ -92,9 +96,11 @@
     piropsig['length']     = 'Is'
     piropsig['load_bytecode'] = 'vs'
     piropsig['load_language'] = 'vs'
+    piropsig['loadlib']    = 'P~'
     piropsig['mod']        = 'PP+'
     piropsig['mul']        = 'PP+'
     piropsig['neg']        = 'PP'
+    piropsig['new']        = 'P~'
     piropsig['newclosure'] = 'PP'
     piropsig['not']        = 'PP'
     piropsig['ord']        = 'Isi'
@@ -117,7 +123,9 @@
     piropsig['split']      = 'Pss'
     piropsig['sub']        = 'PP+'
     piropsig['substr']     = 'Ssii'
+    piropsig['titlecase']  = 'Ss'
     piropsig['trace']      = 'vi'
+    piropsig['typeof']     = 'SP'
     piropsig['unshift']    = '0P*'
     piropsig['upcase']     = 'Ss'
     set_global '%piropsig', piropsig

Modified: branches/unshared_buffers/include/parrot/hash.h
==============================================================================
--- branches/unshared_buffers/include/parrot/hash.h	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/include/parrot/hash.h	Sat Aug  7 01:10:11 2010	(r48340)
@@ -11,11 +11,11 @@
 
 typedef enum {
     enum_hash_undef,
-    enum_hash_int = enum_type_INTVAL,
-    enum_hash_num = enum_type_FLOATVAL,
+    enum_hash_int    = enum_type_INTVAL,
+    enum_hash_num    = enum_type_FLOATVAL,
     enum_hash_string = enum_type_STRING,
-    enum_hash_pmc = enum_type_PMC,
-    enum_hash_ptr = enum_type_ptr
+    enum_hash_pmc    = enum_type_PMC,
+    enum_hash_ptr    = enum_type_ptr
 } HashEntryType;
 
 
@@ -23,7 +23,7 @@
 typedef UINTVAL BucketIndex;
 #define INITBucketIndex ((BucketIndex)-2)
 
-#define N_BUCKETS(n) ((n) - (n)/4)
+#define N_BUCKETS(n) ((n))
 #define HASH_ALLOC_SIZE(n) (N_BUCKETS(n) * sizeof (HashBucket) + \
                                      (n) * sizeof (HashBucket *))
 

Modified: branches/unshared_buffers/src/call/args.c
==============================================================================
--- branches/unshared_buffers/src/call/args.c	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/src/call/args.c	Sat Aug  7 01:10:11 2010	(r48340)
@@ -828,9 +828,8 @@
                     EXCEPTION_INVALID_OPERATION,
                     "named parameters must follow all positional parameters");
 
-            collect_positional = Parrot_pmc_new(interp,
-                Parrot_get_ctx_HLL_type(interp, enum_class_ResizablePMCArray));
-            VTABLE_set_integer_native(interp, collect_positional,
+            collect_positional = Parrot_pmc_new_init_int(interp,
+                Parrot_get_ctx_HLL_type(interp, enum_class_ResizablePMCArray),
                 positional_args - arg_index);
 
             for (j = 0; arg_index < positional_args; ++arg_index) {

Modified: branches/unshared_buffers/src/hash.c
==============================================================================
--- branches/unshared_buffers/src/hash.c	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/src/hash.c	Sat Aug  7 01:10:11 2010	(r48340)
@@ -1446,7 +1446,7 @@
     HashBucket   **prev   = &hash->bucket_indices[hashval];
     if (*prev) {
         const hash_comp_fn compare = hash->compare;
-        for ( ; *prev; prev = &(*prev)->next) {
+        for (; *prev; prev = &(*prev)->next) {
             HashBucket *current = *prev;
             if ((compare)(interp, key, current->key) == 0) {
                 *prev = current->next;

Modified: branches/unshared_buffers/src/pmc.c
==============================================================================
--- branches/unshared_buffers/src/pmc.c	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/src/pmc.c	Sat Aug  7 01:10:11 2010	(r48340)
@@ -573,10 +573,9 @@
     PMC *const classobj = interp->vtables[base_type]->pmc_class;
 
     if (!PMC_IS_NULL(classobj) && PObj_is_class_TEST(classobj)) {
-        PMC * const initial =
-          Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
-        VTABLE_set_integer_native(interp, initial, init);
-        return VTABLE_instantiate(interp, classobj, initial);
+        PMC * const obj = VTABLE_instantiate(interp, classobj, PMCNULL);
+        VTABLE_set_integer_native(interp, obj, init);
+        return obj;
     }
     else {
         PMC * const pmc = get_new_pmc_header(interp, base_type, 0);

Modified: branches/unshared_buffers/src/pmc/callcontext.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/callcontext.pmc	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/src/pmc/callcontext.pmc	Sat Aug  7 01:10:11 2010	(r48340)
@@ -397,14 +397,13 @@
 {
     ASSERT_ARGS(get_named_names)
     Hash *hash;
-    PMC  *result = PMCNULL;
 
     GETATTR_CallContext_hash(interp, SELF, hash);
 
     /* yes, this *looks* risky, but it's a Parrot STRING hash internally */
     if (hash && hash->entries) {
         UINTVAL i, j = 0;
-        result = Parrot_pmc_new_init_int(interp, enum_class_FixedStringArray, hash->entries);
+        PMC *result = Parrot_pmc_new_init_int(interp, enum_class_FixedStringArray, hash->entries);
 
         for (i = 0; i <= hash->mask; ++i) {
             HashBucket *b = hash->bucket_indices[i];
@@ -415,9 +414,11 @@
                 b = b->next;
             }
         }
+
+        return result;
     }
 
-    return result;
+    return PMCNULL;
 }
 
 #include "parrot/packfile.h"

Modified: branches/unshared_buffers/src/pmc/default.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/default.pmc	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/src/pmc/default.pmc	Sat Aug  7 01:10:11 2010	(r48340)
@@ -360,6 +360,23 @@
 
 /*
 
+=item C<void init_int(INTVAL initvalue)>
+
+Calls C<init()> and C<set_integer_native(initvalue)>.
+Default implementation to allow more usages of init_int without having to
+implement it everywhere.
+
+=cut
+
+*/
+
+    VTABLE void init_int(INTVAL initvalue) {
+        SELF.init();
+        SELF.set_integer_native(initvalue);
+    }
+
+/*
+
 =item C<void destroy()>
 
 Does nothing.

Modified: branches/unshared_buffers/src/pmc/env.pmc
==============================================================================
--- branches/unshared_buffers/src/pmc/env.pmc	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/src/pmc/env.pmc	Sat Aug  7 01:10:11 2010	(r48340)
@@ -10,9 +10,6 @@
 
 C<Env> is a singleton class which provides access to the system environment.
 
-XXX Think about returning Pair back. Currently there is no way to iterate over
-environment I<keys>.
-
 =head2 Methods
 
 =over 4

Modified: branches/unshared_buffers/t/native_pbc/annotations.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/unshared_buffers/t/native_pbc/integer.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/unshared_buffers/t/native_pbc/number.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/unshared_buffers/t/native_pbc/string.pbc
==============================================================================
Binary file (source and/or target). No diff available.

Modified: branches/unshared_buffers/t/pmc/oplib.t
==============================================================================
--- branches/unshared_buffers/t/pmc/oplib.t	Fri Aug  6 21:19:43 2010	(r48339)
+++ branches/unshared_buffers/t/pmc/oplib.t	Sat Aug  7 01:10:11 2010	(r48340)
@@ -26,7 +26,7 @@
 
 .sub main :main
     .include 'test_more.pir'
-    plan(12)
+    plan(13)
     new_oplib()
     check_elements()
     getint_end()
@@ -102,8 +102,11 @@
     ok($I0, "got same result from both ways")
 
     $I1 = op
-    $I0 = oplib['end']
+    $I0 = oplib[TESTED_OP]
     is($I0, $I1, 'opcode number from Opcode and from OpLib is the same')
+
+    $S0 = op
+    is($S0, TESTED_OP, 'name from Opcode matches name searched for')
 .end
 
 .sub family_end


More information about the parrot-commits mailing list