PTAL.
This turned into a larger CL, so here are the major changes to look for:
- Switched to an external array (i.e. cache_cells) which holds pairs of AST
ids
and global property cells used for caching call targets (used by
MarkCompactCollector and TypeFeedbackOracle).
- Passing reference to the cache cell as a third register argument to the
CallConstructStub now.
- Adapted debugger to above change.
- Ported to x64 and ARM architectures.
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/builtins-ia32.cc
File src/ia32/builtins-ia32.cc (right):
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/builtins-ia32.cc#newcode421
src/ia32/builtins-ia32.cc:421: CallConstructStub
stub(NO_CALL_FUNCTION_FLAGS);
On 2012/01/23 10:39:52, Vyacheslav Egorov wrote:
according to isolate initialization sequence stub cache is initialized
after
builtins so I sense an ordering problem here.
The CodeStubs are not stored in the stub cache but in a dictionary
reachable through heap()->code_stubs(), that is part of the root set. So
I don't see any ordering problem here. Please let me know if I am wrong
on this one.
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/code-stubs-ia32.cc
File src/ia32/code-stubs-ia32.cc (left):
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/code-stubs-ia32.cc#oldcode4576
src/ia32/code-stubs-ia32.cc:4576: void
CallFunctionStub::FinishCode(Handle<Code> code) {
On 2012/01/23 10:39:52, Vyacheslav Egorov wrote:
Did it disappear? I can't find it.
Done. It was still there on line 4633. No longer needed with new
approach.
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/code-stubs-ia32.cc
File src/ia32/code-stubs-ia32.cc (right):
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/code-stubs-ia32.cc#newcode4600
src/ia32/code-stubs-ia32.cc:4600: Label initialize, call;
On 2012/01/23 10:39:52, Vyacheslav Egorov wrote:
I would rename call to done.
Done.
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/code-stubs-ia32.cc#newcode4604
src/ia32/code-stubs-ia32.cc:4604: __ mov(ebx, Operand(ebx, 1)); // 1 ~
sizeof 'test eax' opcode in bytes.
On 2012/01/23 10:39:52, Vyacheslav Egorov wrote:
you can generate assertion into instruction stream that verifies that
next
instruction is test eax, ...
Done. No longer needed with new approach.
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/full-codegen-ia32.cc
File src/ia32/full-codegen-ia32.cc (right):
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/full-codegen-ia32.cc#newcode2332
src/ia32/full-codegen-ia32.cc:2332: __ call(stub.GetCode(),
RelocInfo::CODE_TARGET, expr->id());
On 2012/01/23 10:39:52, Vyacheslav Egorov wrote:
RelocInfo::CONSTRUCT_CALL
Done. Required some changes in the debugger.
https://chromiumcodereview.appspot.com/8932004/diff/1/src/ia32/full-codegen-ia32.cc#newcode2335
src/ia32/full-codegen-ia32.cc:2335: if (record_call_target) {
On 2012/01/23 10:39:52, Vyacheslav Egorov wrote:
I am curious if you can introduce helper method (e.g. on macro
assembler?) which
both generates call to stub _and_ emits test eax instruction if
necessary. This
way nobody will forget it.
Done. No longer needed with new approach.
https://chromiumcodereview.appspot.com/8932004/diff/1/src/type-info.cc
File src/type-info.cc (right):
https://chromiumcodereview.appspot.com/8932004/diff/1/src/type-info.cc#newcode571
src/type-info.cc:571: if (CallStub::HasCache(target)) {
On 2012/01/23 10:39:52, Vyacheslav Egorov wrote:
It's a bit confusing that HasCache also verifies whether target is a
CallStub.
Maybe call it: CallStub::IsCallStubWithCache?
Done. No longer needed with new approach.
https://chromiumcodereview.appspot.com/8932004/
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev