RevisionLog13000台

rev13999


r13999
Inlining of calls with optional parameters.
ComputeSSA()の引数に、<Definition*>のinlining_parameters引数追加
引数に指定されていれば、graph_entryにinitial_definitions()に追加する。
inliningされる関数の引数は、ConstantInstrである場合の畳み込みが実装されている。
(linliningの結果、ssa_temp_indexを不要に増やさない工夫のはず. ReplaceUsesWith()するだけ)
AdjustForOptionalParameters()がでかい。
OptionalParameterのargumentsとdefaultvalueをstubに突っ込む
inline展開の前に、optional parameterを解決する。

r13974
isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue.
リネームのみ。

r13973
Convert 'identical' to strict equal.
identicalがTopLevelで定義されている場合
identicalをVisitStaticCallNode()でStrictCompareInstrに変換

r13969
Propagate class-id through checked mode type checks.
AssertAssignableInstrに、propagated_cid()追加

r13927
Restructure code generation timers and add sub-timers for inlining phases.
timer関連の修正. inliningの際に、Timerをネストして使用。
オプション compiler_stats
timerでinliningの以下を細かく測定
1.ParseFunction()
2.BuildGraph()
3.ComputeSSA() && ComputeUseLists()
4.ApplyICData() && ComputeUseLists()
5.InlineCall() && parameter ReplaceUsesWith


r13922
Avoid rediscovering blocks on each call to FlowGraph::InlineCall.
inliningのあとの、caller側のirとcallee側のirを再解析するのではなくて、
RepairGraphAfterInlining()によって、DominatorTreeを
ReplacePredecessorでメンテ
DiscoverBlocksの回数を減らした。


r13907
EqualOperator ==
Fix super ==: Test first for null before call inf super ==.
EmitSuperEqualityCallPrologue()ってなんぞや
ESP+0がnullだったら,check_identity
ESP+wordがnullでなければ,fall
check_identity:
cmpl result, ESP+0
NOT_EQUAL goto is_false
LoadObject result, bool_true()
goto skip_call
is_false:
LoadObject result, bool_false()
goto skip_call
fall::

何に使うのかよくわからん。。
StaticCallInstrが、equality(==)だった場合に呼び出す。
nullであるケースをprologueでskipして、equality演算がpolymorphicInstanceCallになることを
防いでいるのか?

A.==(B)と仮定すると、
ESP+0がA
ESP+wordとresultがB
A(null) == B -> cmp A, result -> resultがnullでtrue, skip
A == B(null) -> cmp A, result -> resultがnullでtrue, skip
A == B -> fall


r13893
Inline load and store index on Float32Arrays.
Float32ArrayCidが、intrinsicsになった。
Float64ArrayCidと比較すると、
loadIndexedの場合は、movss, cvtss2sdしないといけない。
storeIndexedの場合は、逆にcvtsd2ss, movss
メモリ使用量では少ない。

r13882
Cache parsed functions when inlining.
ParsedFunctionからParsedFunction* に変更
inliningされた関数は、flow_graph_inlinerにキャッシュされるようになった。
inliningの度に、関数を再生成しなくてすむので、コンパイル時間にやさしい。

r13871
Avoid creating unnecessary environments during SSA renaming.
Only instructions that can deoptimize and Goto-instructions
ever need an environment.
CanDeoptimize()とGotoのときだけ、set_env()するらしい。

r13866
Make hashCode a getter and not a method.
String_hashCodeからString_getHashCode()にリネーム。
中身はintrinsicsで、
String::hash_offset()の値をmovlで取得し、0か比較した後に返す。


r13859
Enable redundancy elimination for array loads.
This CL also adds a second round of CSE if necessary to make use
of secondary effects for more optimization opportunities.
CSEでLoadIndexedInstrを削除できるようにした。
基本的には、lookupの対象にして、
LoadIndexedInstrに、AttributesEquals()とAffectedBySideEffect()メソッドを追加しただけ。
boolを返すようにし、成功すればDominatorBasedCSEが2回め走る

rev13843


リビジョンログを読んで興味深かったもの抜粋


r13840
Tuned inlining parameters:
inlining_size_threshold: 250 -> 50
inlining_depth_threshold: 1 -> 3
All measurements on my Linux box:
dart2js: 2% slower, 9% increased code size.
The following benchmarks got approx. 20% faster: DeltaBlueClosures, Richards, BinaryTrees, Sum, Towers, Ra
thresholdの初期値を調整したのみ。
50と3になった。
でも3だとVMがCrashするので、今は1に戻っている。

r13823
Fix bigint modulo operation. Fixes bug 6056
moduleがNegativeか非Negativeか参照し、補正を行う。

r13798
Apply optimization after class-id propagation:
instance calls without ICData are optimized by using input argument class-ids to create fake ICData.
This reduces the number of deoptimizations.
OptimizerにApplyClassIds()を追加
PropagateSminess()の実行後に、ICDataがないICを、引数の型から推定する。
その結果、deoptimizeの挿入を減らす。
BBとinstをたどって、ICだったら、TryCreateICData() VisitInstanceCall()
ICData(ProfileしたType)がない場合、Argの型を見て,icdataを生成して設定する。
現在、Argの型は1つのみ対応。
Resolver::ResolveDynamicForReceiverClass()を使って対象の関数を取得。

r13794
Inline indexed store ([]=) array operations in checked mode.
enable_type_checksの際にも、TryReplaceWithStoreIndexedでされるように処理追加
AssertAssignableInstrを追加する

r13792
Do not bump allocate in old-space pages. Always use
the freelist in preparation for chunked allocation.
gc_sweeperとpagesを修正
BumpAllocateを廃止
代わりにfreelistをFree

r13762
Fix optimization of %: replace IC call even if not optimizable.
fix bug

r13712
In optimized code always deoptimize if we encounter an instance call without type feedback (ICData has no
Fix a bug in inliner: do not inline methods that have no compiled code as we can not deoptimize into them.
This improves the speed of Meteor by 15% and NavierStokes by 40% (Mac OS X).
InstanceCallをFlowGraphCompilerでEmitする際に、
もしICでプロファイル済みだった場合、これまでと同様。
もしICでプロファイルしていない(未通過のパス)だった場合、
DeoptInstanceCallNoICDataというタグ付きでDeoptするコードを生成する。
最適化後に、最適化前に未通過のICを呼び出した場合、Deoptする。

r13704
Add value tests to intrinisics GrowableArray _setData and setLength.
Thos are private native methods that could be invoked via mirrors with incorrect values.
_setData
setLength
所々にSmiTagのチェック処理を追加

r13703
Intrinsify writing to Uint8 and Int8 arrays on IA32.
以下のintrinsicsを追加
Uint8Array setIndexed
Int8Array setIndexed
mov EBX, Address(ESP, 1 * word)
SmiUntag(EBX)
addl EBX, 128
cmpl EBX, 0xFF
j ABOVE, fall_through
sub EBX, 128
movb Address(EAX, EDI, TIMES_1), BL //EAX=base, EDI=index, Store BL
ret

r13696
Intrinsify natural world typed array getters
Int32ArrayとUInt32ArrayのgetIndexedをassemblerで実装
setIndexはまだです。。
値を取り出してsmiに収まらなければreturn false

r13685
Fix receiver's type for constructors.
リファクタリング

r13683
Optimize type checks for boolean expressions using class-id information.
This CL adds a canonicalization pass for AssertBoolean instructions.
If the input class id is guaranteed to be bool, the check can be eliminated.
AssertBooleanInstrはcanonicalizationのvisitorが走った際に、
bool型の場合はdefinitionを返してbool型を伝搬し、冗長なCheckClassを削除

r13682
Inline indexed load and store of typed array float64.
NavierStokes time improves from 34,775us to 12,000us (v8 runs NavierStokes in 16000 us).
今後こういう修正が増えていくのかも。
LoadIndexInstrとStoreIndexInstr周りを大幅改良
kFloat64ArrayCid用の特殊化を随所に埋め込み
TryReplaceWithArrayOpをリファクタリングして、
PrepareIndexedOpとTryReplaceWithStoreIndexedとLoadIndexedに変更
LoadIndexとStoreIndexのEmitNativeCodeも修正
Float64ArrayCidの場合,StoreIntoObjectを使用しない。movsdのみ。
StoreIntoObjectNoBarrierの場合もmovlのみ発行.
Float64ArrayCidの場合は、レジスタ割付で無駄な命令が発行されなくなる?
LoadIndexは特の実装と比較して速いわけではないが、
unboxdouble向けにlocation情報を提供して、doubleのままxmmにloadできるようになった。

r13664
Fix crashes in intrinsified float32/float64 array setters when attempting to store a Smi. Added tests.
intrinsicsのsetIndexed()において、EAX(Base)のsmiチェックを追加

実際のソースコード比較

diff


rev13637


リビジョンログを読んで興味深かったもの抜粋

r13581
Get rid of RawClosure class and use RawInstance for closures.
Simplify SetRaw to not require an access to the Current Isolate.
Closureクラスが、InstanceからAllStaticになった。
Instanceをコンストラクタでもらう.返り値はInstance
ClosureのInstanceから直接Isolateへアクセスすることを除去
snapshotも簡略化

r13576 | srdjan@google.com | 2012-10-12 04:44:47 +0900 (金, 12 10月 2012) | 2 lines
Apply John's change (Issue 11077007: Intrinsify Float64 array access on ia32 and x64.).
Float64Array_のintrinsicsが実装。ia32とx64にて。
scalarlistのFloat64が高速になったはず。
getIndexed()では、
TestByteArrayIndex()の後、 EAX(base address) + EBX(smi tagged index) << TIMES_4(ScaleFactor 2)
からxmmに値を取り出したのち、TryAllocate()を呼び出してdoubleでboxingした値を返す。
setIndexed()では、
doubleのインスタンスからunboxingして、xmmに格納。
TestByteArraySetIndex()の後、EAX(base address) + EBX(smi tagged index) << TIMES_4(ScaleFactor 2)
に値を格納。
doubleなのにScaleFactor2なのは、smiが既にshift 1されているから。

r13547
Mark optimized functions with a * in the perf event symbol output.
This allows to distinguish time spent in optimized code vs unoptimized code
in our profile information.
perfで性能測定する際のsymbolを、最適化前の関数と最適化後の関数に分けて区別できるようにした。
最適化後の関数は、頭に*がつく。

r13471
Recursive inlining.
Due to large performance regressions on dart2js the default depth is set to 1,
i.e., we only inline the first level of calls by default.
The depth can be changed with the inlining_depth_threshold flag.
深さ優先でcallgraphをたどって、inline展開する。
inlining_depth_threshold=1が初期値で、1回inline展開を試行する。
2だと、1回inline展開をして、さらにその中の関数をinline展開する。

r13443
Implement SmiToInt and DoubleToInt. All necessary tests are in tests/language/arithmetic_test.dart
toIntメソッドを特殊化し、DoubleToInteger命令追加
recognized_kingに追加
doubleをunboxして、Smitag
もしMintだった場合は、GenerateStaticCall

r13408
Faster 64-bit left-shift for ia32.
This CL adds a fast left-shift that operates on unboxed mints.
(64-bit integers) to the ia32 optimizing compiler.
ShiftMintOpInstr::EmitNativeCodeにSHL実装
lowとhighをそれぞれshlした後に、
highをsarlして、overflowを判定、だめな場合はdeopt

r13372
Fix bug with missing unboxed mint-to-double conversion.
In case of a mixed integer/double operation that has a mint
input, the corresponding conversion from unboxed mint to unboxed
double was missing.

This CL converts a unboxed mint to a double by first boxing,
and then unboxing. Currently, we deoptimize in case the result
does not fit into a smi because we can only optimize mixed
smi/double operations and not yet mint/double operations.
パターンマッチで特殊化した命令に置換
from == kTagged && to == kUnboxedMint
from == kUnboxedMint && to == kTagged
from == kUnboxedMint && to == kUnboxedDouble
from == kUnboxedDouble && to == kTagged
from == kTagged && to = kUnboxedDouble

r13352
Hide internal details of VM string implementation.
StringBaseクラスがVM内部に隠蔽
今後どんどん高速なintrinsicsを追加していくのだと思う。
get:length
charCodeAt
hashCode
isEmpty

実際のソースコード比較

diff 5k

version情報を管理するクラスを追加。今はv0.1.x

Dynamicがdynamicにリファクタリング。コメントこみこみ。

Zoneクラスリネーム
Zone->StackZone
BaseZone->Zone

debugger_apiにisolate_idを追加

FlowGraphVisualizerが削除

Leaf系が全部削除。
isLeaf()や、EnterDartLeafFrame()がなくなった。

namespaceのexportが追加。新しい構文?

rev13295(edge)


リビジョンログを読んで興味深かったもの抜粋


r13295
Faster 64-bit right-shift for the ia32 compiler.
ShiftMintOpInstr中間表現追加
codegenにも、ShiftMintOpを追加
optimizerで、kMintCidかつkSHRの場合、ShiftMintOpInstrを生成
kSHLは未実装。

r13254
Support for mixed null/smi equality: do not deoptimize,
emit same optimized code as if that was smi-equality only.
Moved assert for duplicate class checks into ICData.
Allow CheckClassInstr to check for Smi as well.
RUNTIME_ENTRY UpdateICDataTwoArgs() 追加
EqualityWithNullArg をstubに実装。 ia32とx64に各々。
Smi型のEquality比較だとしても、
初期化していない場合に、nullが設定されている可能性がある。
その場合、smi, nullの2型になり得るので、
vm内部では、smi型のみの特殊化として扱う。
将来は、DoubleとMintにも拡張する予定。

r13237
Renaming Unboxed* IL instructions to shorter names.
Since we don't have boxed mint and double operations anymore,
we can use shorter names.
Unboxedっていうキーワードがなくなった。地味にうれしい。

r13221
Add fast 64-bit bitwise negation to the IA32 optimizing compiler.
UnboxedMintUnaryOp中間表現を追加
ia32のAssemblerにpxorを追加
kBIT_NOTのを特殊可を追加

r13211
Add fast 64-bit integer ADD and SUB to the optimizing compiler.
They operate on unboxed 64-bit integers stored in xmm registers.
I also fixed an issue with some SSE 4 specific assembler
tests where we hit an assert with an empty assembler buffer
when running with --no-use-sse41.
ia32のMintの計算を特殊化。x64は不要。
ia32のdecoderにsimd追加
sqrtss addss mulss subss divss cvtdq2pd

TryReplaceWithBinaryOpに特殊化パス追加
HasOnlyTwoSmi
HasTwoMintOrSmi
ShouldSpecializeForDouble

UnboxedMintBinaryOpInstrのEmitNativeCodeを拡張
kAddとkSubが追加された。以前はAnd OR XORのみだった。
基本的に、kAddの場合は、addl adcl, kSubの場合は、subl sbbl


r13170
Run canonicalization again after constant propagation.
This eliminates smi checks of constant-valued instructions. Also fix
printing of block numbers in code comments.
optimizer.OptimizeComputations()を追加


r13112
Support for unboxed 64-bit integer bitwise operations and equality on ia32.
This CL adds AND, OR, XOR and == operations on unboxed 64-bit integers
(aka. mints).
Unboxed mints are stored in xmm registers. Each xmm register location
has an additional bit to keep track of its value representation.
Unboxed mints are materialized on the heap on deoptmization in the same way as
unboxed doubles.
The SSE instructions used are available on all CPUs that support SSE 4.1.
IA32の場合、Representation最適化にDoubleの他にMintを追加
X64環境は関係ない。Mintは64bit integerなので。

IRに、UnboxInteger BoxInterger UnboxedMintBinaryOpが追加
Allocatorにも手が入っていて、MintはDoubleと同様、XmmRegisterにMaterializeされる。
LiveRangeも、DoubleとMintはどうように計算される。

r13081
Revert r13022 (revert inlining of methods with control flow),
disable inlining of methods with control-flow so that we do not run out of heap space.
InlineBailoutが削除、control flow系(case, do-while, jump backを含んだもの)がinline展開可能に。
REorderPhisを追加して、番号振り直し
PolymorphicInstanceCallもinline展開可能に。Call数の制限はないけど、グラフの大きさで制限。
オプション多数追加
    • inlining-size-threshold=250
    • inline-control-flow=false
    • inlining-growth-factor=3

実際のソースコード比較

diff 8k

オプション追加
    • trap-on-deoptimization=false
    • unbox-mints=true
    • trace_deoptimization=false
    • trace_deoptimization_verbose=false
verboseを指定すると、DeferredMints()を表示する


XMM Registers は、kDoubleとkMintで同様に使う

scavenger
row_obj->isWatched()
the delayed WeakProperty用のscavenge処理
DelayWeakPropertyは、IsHeapObject() && IsOldObject() && !row_key->IsMarked()

SLOW_ASSERT(cond)追加 slow_asserts=falseオプション追加

以下を追加
RawICData* AsUnaryClassChecksForArgNr()
RawICData* AsUnaryClassChecks()

edgeで、ThrowNoSucMethodErrorの制御が変わっていたけど、
parse周りが変更された影響かも
ErrorMsgで埋め込まれていたのが、ThrowNoSuchMethodError()呼び出しになっている。


Isolateに、RawMintとRawIntegerが追加
Isolate用に、Debuggerのportや,signalhandlerの処理を追加している。

deopt周りがかなり改善されててわからん


vm/ast
MakeAssignmentNodeを追加
getterがない場合,'throw NoSuchMethodError'
ほかはとりあえずreturn null
もうちょっと固めにチェックしてほしいけどね。

EmitUnboxedMintEqualityOp
movaps xmm0, left
pcmpeqq xmm0, right
movd temp, xmm0
compl temp, -1
xmm0は、レジスタ割付で割り付けられたxmmの仮番号0なので、xmm0固定という意味ではない。

rev13046(edge)

地味に性能が上がった。

リビジョンログを読んで興味深かったもの抜粋

r13040
Convert MOD to AND for power-of-two positive constants.
MODがConstantかつSmiである場合、BinarySmiOpInstrのBIT_ANDに変換

r13032
Inline String isEmpty, refactor inlining of intrinsics.
RECOGNIZED_LISTの処理をリファクタリング
isEmptyを追加

r12989
Don't inline recursive calls.
しないらしい。そもそも今までしていたんだっけ?

実際のソースコード比較

diff 4k

リファクタリングが多いので、差分は多くでている。

RECOGNIZED_LIST の変更
_ObjectArray,
_ImmutableArray,
_GrowableObjectArray, get:length
_GrowableObjectArray, get:capacity
StringBase, isEmpty

Float32Arrayってのが、ia32とx64に実装されたけど、何に使うのか。。

FlowGraphCompiler::EmitEqualityRegConstCompare()
Register型だった場合、Smi::Castのあとtestqで判定
Operandの片側がconstだった場合に呼び出す。

  • 最終更新:2012-10-24 23:17:08

このWIKIを編集するにはパスワード入力が必要です

認証パスワード