Esempio n. 1
0
 def consider_call_site(descs, args, s_result, op):
     cnt, keys, star = rawshape(args)
     shape = cnt + 1, keys, star  # account for the extra 'self'
     row = build_calltable_row(descs, args, op)
     family = descs[0].getcallfamily()
     family.calltable_add_row(shape, row)
     descs[0].mergecallfamilies(*descs[1:])
Esempio n. 2
0
 def consider_call_site(descs, args, s_result, op):
     cnt, keys, star = rawshape(args)
     shape = cnt + 1, keys, star  # account for the extra 'self'
     row = build_calltable_row(descs, args, op)
     family = descs[0].getcallfamily()
     family.calltable_add_row(shape, row)
     descs[0].mergecallfamilies(*descs[1:])
Esempio n. 3
0
 def variant_for_call_site(bookkeeper, family, descs, args, op):
     shape = rawshape(args)
     bookkeeper.enter(None)
     try:
         row = FunctionDesc.row_to_consider(descs, args, op)
     finally:
         bookkeeper.leave()
     index = family.calltable_lookup_row(shape, row)
     return shape, index
Esempio n. 4
0
 def variant_for_call_site(bookkeeper, family, descs, args, op):
     shape = rawshape(args)
     bookkeeper.enter(None)
     try:
         row = FunctionDesc.row_to_consider(descs, args, op)
     finally:
         bookkeeper.leave()
     index = family.calltable_lookup_row(shape, row)
     return shape, index
Esempio n. 5
0
    def test_rawshape(self):
        args = MockArgs([1, 2, 3])
        assert rawshape(args) == (3, (), False)

        args = MockArgs([1, 2, 3, 4, 5])
        assert rawshape(args) == (5, (), False)

        args = MockArgs([1], {'c': 3, 'b': 2})
        assert rawshape(args) == (1, ('b', 'c'), False)

        args = MockArgs([1], {'c': 5})
        assert rawshape(args) == (1, ('c', ), False)

        args = MockArgs([1], {'c': 5, 'd': 7})
        assert rawshape(args) == (1, ('c', 'd'), False)

        args = MockArgs([1, 2, 3, 4, 5], {'e': 5, 'd': 7})
        assert rawshape(args) == (5, ('d', 'e'), False)
Esempio n. 6
0
    def test_rawshape(self):
        args = MockArgs([1, 2, 3])
        assert rawshape(args) == (3, (), False)

        args = MockArgs([1, 2, 3, 4, 5])
        assert rawshape(args) == (5, (), False)

        args = MockArgs([1], {'c': 3, 'b': 2})
        assert rawshape(args) == (1, ('b', 'c'), False)

        args = MockArgs([1], {'c': 5})
        assert rawshape(args) == (1, ('c', ), False)

        args = MockArgs([1], {'c': 5, 'd': 7})
        assert rawshape(args) == (1, ('c', 'd'), False)

        args = MockArgs([1, 2, 3, 4, 5], {'e': 5, 'd': 7})
        assert rawshape(args) == (5, ('d', 'e'), False)
Esempio n. 7
0
    def test_rawshape(self):
        space = DummySpace()
        args = make_arguments_for_translation(space, [1,2,3])
        assert rawshape(args) == (3, (), False, False)

        args = make_arguments_for_translation(space, [1])
        assert rawshape(args, 2) == (3, (), False, False)

        args = make_arguments_for_translation(space, [1,2,3,4,5])
        assert rawshape(args) == (5, (), False, False)

        args = make_arguments_for_translation(space, [1], {'c': 3, 'b': 2})
        assert rawshape(args) == (1, ('b', 'c'), False, False)

        args = make_arguments_for_translation(space, [1], {'c': 5})
        assert rawshape(args) == (1, ('c', ), False, False)

        args = make_arguments_for_translation(space, [1], {'c': 5, 'd': 7})
        assert rawshape(args) == (1, ('c', 'd'), False, False)

        args = make_arguments_for_translation(space, [1,2,3,4,5], {'e': 5, 'd': 7})
        assert rawshape(args) == (5, ('d', 'e'), False, False)
Esempio n. 8
0
 def consider_call_site(bookkeeper, family, descs, args, s_result, op):
     cnt, keys, star = rawshape(args)
     shape = cnt + 1, keys, star  # account for the extra 'self'
     row = FunctionDesc.row_to_consider(descs, args, op)
     family.calltable_add_row(shape, row)
Esempio n. 9
0
 def consider_call_site(bookkeeper, family, descs, args, s_result, op):
     shape = rawshape(args)
     row = FunctionDesc.row_to_consider(descs, args, op)
     family.calltable_add_row(shape, row)
Esempio n. 10
0
 def find_row(self, bookkeeper, descs, args, op):
     shape = rawshape(args)
     with bookkeeper.at_position(None):
         row = build_calltable_row(descs, args, op)
     index = self.calltable_lookup_row(shape, row)
     return shape, index
Esempio n. 11
0
 def consider_call_site(descs, args, s_result, op):
     family = descs[0].getcallfamily()
     shape = rawshape(args)
     row = build_calltable_row(descs, args, op)
     family.calltable_add_row(shape, row)
     descs[0].mergecallfamilies(*descs[1:])
Esempio n. 12
0
 def consider_call_site(bookkeeper, family, descs, args, s_result, op):
     cnt, keys, star = rawshape(args)
     shape = cnt + 1, keys, star  # account for the extra 'self'
     row = FunctionDesc.row_to_consider(descs, args, op)
     family.calltable_add_row(shape, row)
Esempio n. 13
0
 def consider_call_site(bookkeeper, family, descs, args, s_result, op):
     shape = rawshape(args)
     row = FunctionDesc.row_to_consider(descs, args, op)
     family.calltable_add_row(shape, row)
Esempio n. 14
0
 def find_row(self, bookkeeper, descs, args, op):
     shape = rawshape(args)
     with bookkeeper.at_position(None):
         row = build_calltable_row(descs, args, op)
     index = self.calltable_lookup_row(shape, row)
     return shape, index
Esempio n. 15
0
 def consider_call_site(descs, args, s_result, op):
     family = descs[0].getcallfamily()
     shape = rawshape(args)
     row = build_calltable_row(descs, args, op)
     family.calltable_add_row(shape, row)
     descs[0].mergecallfamilies(*descs[1:])
Esempio n. 16
0
 def consider_call_site(descs, args, s_result, op):
     shape = rawshape(args)
     row = FunctionDesc.row_to_consider(descs, args, op)
     family = descs[0].getcallfamily()
     family.calltable_add_row(shape, row)