📄 opt_inliners.mx
字号:
@' The contents of this file are subject to the MonetDB Public License@' Version 1.1 (the "License"); you may not use this file except in@' compliance with the License. You may obtain a copy of the License at@' http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html@'@' Software distributed under the License is distributed on an "AS IS"@' basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the@' License for the specific language governing rights and limitations@' under the License.@'@' The Original Code is the MonetDB Database System.@'@' The Initial Developer of the Original Code is CWI.@' Portions created by CWI are Copyright (C) 1997-2007 CWI.@' All Rights Reserved.@f opt_inliners@a M. Kersten@subsection Function InlinersThe routine @sc{optimizer.inliners()} searches MAL function definitionswhose property @{inline@} is set. In addition, all MAL function callswhose primary target variable carry the @{inline@} property are inlinedas well.The code is expanded inline using the macro processor.@{@malpattern optimizer.inliners():straddress OPTinliners;pattern optimizer.inliners(mod:str, fcn:str):straddress OPTinlinerscomment "Expand inline functions";@h#ifndef _OPT_INLINE_#define _OPT_INLINE_#include "opt_prelude.h"#include "opt_support.h"#include "mal_interpreter.h"#include "opt_macro.h"#define DEBUG_OPT_INLINE /* show partial result */#endif@c#include "mal_config.h"#include "opt_inliners.h"static intOPTinlinersImplementation(MalBlkPtr mb, MalStkPtr stk, InstrPtr p){ int i; InstrPtr q,sig; int actions = 0; PropertySet ps; (void) p; for (i = 1; i < mb->stop; i++) { q = getInstrPtr(mb, i); if( q->blk){ sig= getInstrPtr(q->blk,0); ps= getVar(q->blk, getArg(sig,0))->props; if( isPropertyDefined(ps,"inline") ){ inlineMALblock(mb,i,q->blk); actions++;#ifdef DEBUG_OPT_INLINE printFunction(GDKout, mb, LIST_MAL_ALL);#endif } else { ps= getVar(mb, getArg(q,0))->props; if( isPropertyDefined(ps,"inline") ){ inlineMALblock(mb,i,q->blk); actions++;#ifdef DEBUG_OPT_INLINE printFunction(GDKout, mb, LIST_MAL_ALL);#endif } } } } (void)stk; return actions;}@include optimizerWrapper.mx@h@:exportOptimizer(inliners)@@c@:wrapOptimizer(inliners,OPT_CHECK_ALL)@@}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -