跳至內容

Introspector/GccCpp/tree-dump.c/字元類switch

來自華夏公益教科書,開放書籍,開放世界

如果我們檢視節點類的彙編程式碼,我們將看到以下內容

L5

	subl	$12, %esp	 #,
	leal	-56(%ebp), %eax	 #, tmp119
	pushl	%eax	 # tmp119
	call	TReftree_code_class::operator char()	 #
	addl	$4, %esp	 #,
	movsbl	%al,%eax	 # tmp120, tmp121
	pushl	%eax	 # tmp121
	call	IS_EXPR_CODE_CLASS(char)	 #
	addl	$16, %esp	 #,
	testb	%al, %al	 # tmp122
	je	L21	 #,
	subl	$8, %esp	 #,
	pushl	-24(%ebp)	 # t
	pushl	8(%ebp)	 # di
	call	queue_and_dump_type(dump_info*, tree_common*)	 #
	addl	$16, %esp	 #,
	subl	$12, %esp	 #,
	leal	-56(%ebp), %eax	 #, tmp132
	pushl	%eax	 # tmp132

	call	TReftree_code_class::operator char()	 #
	addl	$16, %esp	 #,
	movb	%al, -257(%ebp)	 #,
	cmpb	$101, -257(%ebp)	 #, "e"
	je	L32	 #,

如果我們等於一個“e”,則跳至#塊 L32

	cmpb	$101, -257(%ebp)	 #,
	jg	L30	 #,

如果我們大於一個“e”,則跳至#塊 L30


	cmpb	$50, -257(%ebp)	 #,
	je	L25	 #,

如果我們等於一個“2”,則跳至塊#塊 L25

	cmpb	$50, -257(%ebp)	 #, // 2
	jg	L31	 #,

如果我們大於一個“2”,則跳至塊#塊 L31


	cmpb	$49, -257(%ebp)	 #, // '1'
	je	L23	 #, // case '1'
	jmp	L29	 #

如果我們有一個“1”,則跳至塊#塊 L29

L31:
	cmpb	$60, -257(%ebp)	 #,
	je	L25	 #,
	jmp	L29	 #

如果我們有一個“<”,則跳至#塊 L25,否則跳至#塊 L29

L30:
	movb	-257(%ebp), %al	 #, tmp134
	subl	$114, %eax	 #, tmp134
	cmpb	$1, %al	 #, tmp134
	ja	L29	 #,
	jmp	L32	 #\

從eax中減去“r”

跳至#塊 L29 跳過

如果我們等於一個“e”,則跳至#塊 L32

華夏公益教科書