12.07.2015 Views

RealView Compilation Tools コンパイラユーザガイド - ARM ...

RealView Compilation Tools コンパイラユーザガイド - ARM ...

RealView Compilation Tools コンパイラユーザガイド - ARM ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

イ ン ラ イ ンアセン ブ ラ と 組 み 込 みアセン ブ ラの 使 用f が 仮 想 メ ンバ 関 数 ではない 場 合 に __vcall_offsetof_vfunc(D, f)を 使 用 する と 、 有 効 であればアセンブ リ エ ラーを 発 生 させる 任意 の 値 を 返 し ます。7.2.9 非 ス タ テ ィ ッ ク メ ンバ 関 数 の 呼 び 出 し__mcall および __vcall で 始 ま る キーワード を 使 用 し て、 __asm 関 数 か ら 非 仮 想関 数 と 仮 想 関 数 を 呼 び 出 せます。 詳 細 については、 「メンバ 関 数 クラスのキーワード」 (ページ 7-26) を 参 照 して 下 さい。 スタティックメンバ 関 数 は 異 なるパラ メータを 受 け 取 るため (this がないなど)、 ス タテ ィ ッ ク メ ンバ 関 数 を 検出 する __mcall_is_static はあ り ません。 し たがっ て、 呼 び 出 し 側 は 既 にス タテ ィ ッ ク メ ンバ 関 数 の 呼 び 出 し に 特 化 さ れてい る と 考 え ら れます。非 仮 想 メ ンバ 関 数 の 呼 び 出 し例 7-6 に、 仮 想 ベース ま たは 非 仮 想 ベースのいずれかで 非 仮 想 関 数 を 呼 び 出すことができるコードを 示 します。例 7-6 非 仮 想 関 数 の 呼 び 出 し// rp contains a D* and we want to do the equivalent of rp->f() where f is a// nonvirtual function// all arguments other than the this pointer are already setup// assumes f does not return a structif __mcall_is_in_vbase(D, f)LDR r12, [rp]// fetch vtable pointerLDR r0, [r12, #-__mcall_offsetof_vbase(D, f)] // fetch the vbase offsetADD r0, r0, rp// do this adjustmentelseADD r0, rp, #__mcall_this_offset(D, f)endifBL __cpp(&D::f)// set up and adjust this// pointer for D*// call D::f仮 想 メ ンバ 関 数 の 呼 び 出 し例 7-7 (ページ 7-29) に、 仮 想 ベース ま たは 非 仮 想 ベースのいずれかで 仮 想 関数 を 呼 び 出 すこ と がで き る コー ド を 示 し ます。7-28 Copyright © 2002-2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0205IJNon-Confidential, ID 100419

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!