Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f1d50684
Kaydet (Commit)
f1d50684
authored
Eki 23, 2005
tarafından
Neal Norwitz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix problem handling EXTENDED_ARGs from SF bug # 1333982
üst
7d37f2ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
compile.c
Python/compile.c
+30
-1
No files found.
Python/compile.c
Dosyayı görüntüle @
f1d50684
...
@@ -3886,17 +3886,20 @@ static void
...
@@ -3886,17 +3886,20 @@ static void
assemble_jump_offsets
(
struct
assembler
*
a
,
struct
compiler
*
c
)
assemble_jump_offsets
(
struct
assembler
*
a
,
struct
compiler
*
c
)
{
{
basicblock
*
b
;
basicblock
*
b
;
int
bsize
,
totsize
=
0
;
int
bsize
,
totsize
,
extended_arg_count
,
last_extended_arg_count
=
0
;
int
i
;
int
i
;
/* Compute the size of each block and fixup jump args.
/* Compute the size of each block and fixup jump args.
Replace block pointer with position in bytecode. */
Replace block pointer with position in bytecode. */
start:
totsize
=
0
;
for
(
i
=
a
->
a_nblocks
-
1
;
i
>=
0
;
i
--
)
{
for
(
i
=
a
->
a_nblocks
-
1
;
i
>=
0
;
i
--
)
{
b
=
a
->
a_postorder
[
i
];
b
=
a
->
a_postorder
[
i
];
bsize
=
blocksize
(
b
);
bsize
=
blocksize
(
b
);
b
->
b_offset
=
totsize
;
b
->
b_offset
=
totsize
;
totsize
+=
bsize
;
totsize
+=
bsize
;
}
}
extended_arg_count
=
0
;
for
(
b
=
c
->
u
->
u_blocks
;
b
!=
NULL
;
b
=
b
->
b_list
)
{
for
(
b
=
c
->
u
->
u_blocks
;
b
!=
NULL
;
b
=
b
->
b_list
)
{
bsize
=
b
->
b_offset
;
bsize
=
b
->
b_offset
;
for
(
i
=
0
;
i
<
b
->
b_iused
;
i
++
)
{
for
(
i
=
0
;
i
<
b
->
b_iused
;
i
++
)
{
...
@@ -3912,8 +3915,34 @@ assemble_jump_offsets(struct assembler *a, struct compiler *c)
...
@@ -3912,8 +3915,34 @@ assemble_jump_offsets(struct assembler *a, struct compiler *c)
int
delta
=
instr
->
i_target
->
b_offset
-
bsize
;
int
delta
=
instr
->
i_target
->
b_offset
-
bsize
;
instr
->
i_oparg
=
delta
;
instr
->
i_oparg
=
delta
;
}
}
else
continue
;
if
(
instr
->
i_oparg
>
0xffff
)
extended_arg_count
++
;
}
}
}
}
/* XXX: This is an awful hack that could hurt performance, but
on the bright side it should work until we come up
with a better solution.
In the meantime, should the goto be dropped in favor
of a loop?
The issue is that in the first loop blocksize() is called
which calls instrsize() which requires i_oparg be set
appropriately. There is a bootstrap problem because
i_oparg is calculated in the second loop above.
So we loop until we stop seeing new EXTENDED_ARGs.
The only EXTENDED_ARGs that could be popping up are
ones in jump instructions. So this should converge
fairly quickly.
*/
if
(
last_extended_arg_count
!=
extended_arg_count
)
{
last_extended_arg_count
=
extended_arg_count
;
goto
start
;
}
}
}
static
PyObject
*
static
PyObject
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment