Reviewers: Michael Starzinger,

Message:
ia32 only. Still missing the sharing for the literals array.


http://codereview.chromium.org/10103035/diff/10006/src/factory.cc
File src/factory.cc (right):

http://codereview.chromium.org/10103035/diff/10006/src/factory.cc#newcode563
src/factory.cc:563: result->set_literals(*literals);
Instead of always allocating a new literals array, check if we can use a
shared literals array from the optimized code map stored, similar to the
way we lookup shared optimized code.

The same strategy has to be implemented for the FastNewClosureStub.

http://codereview.chromium.org/10103035/diff/10006/src/factory.cc#newcode574
src/factory.cc:574:
result->set_next_function_link(isolate()->heap()->undefined_value());
Not needed since next_function_link is already initialized in
Heap::AllocateFunction.

http://codereview.chromium.org/10103035/diff/10006/src/ia32/lithium-codegen-ia32.cc
File src/ia32/lithium-codegen-ia32.cc (right):

http://codereview.chromium.org/10103035/diff/10006/src/ia32/lithium-codegen-ia32.cc#newcode4428
src/ia32/lithium-codegen-ia32.cc:4428: __
push(Immediate(instr->hydrogen()->constant_elements()));
This should not be necessary if we share the literals array in the same
way we share optimized code among closures. So this change should not be
necessary anymore then.

Description:
Share optimized code for closures.

Each SharedFunctionInfo gets an optimized code map to store
one optimized code object per context. When allocating a new
closure we consult this map and check if there is optimized code
that can be shared.

This patch is based on an original patch
by Anton Muhin (http://codereview.chromium.org/6793013/).


Please review this at http://codereview.chromium.org/10103035/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/compiler.cc
  M     src/deoptimizer.h
  M     src/factory.cc
  M     src/flag-definitions.h
  M     src/frames.h
  M     src/frames.cc
  M     src/heap.cc
  M     src/hydrogen-instructions.h
  M     src/hydrogen.h
  M     src/hydrogen.cc
  M     src/ia32/code-stubs-ia32.cc
  M     src/ia32/deoptimizer-ia32.cc
  M     src/ia32/lithium-codegen-ia32.cc
  M     src/mark-compact.cc
  M     src/objects-debug.cc
  M     src/objects-inl.h
  M     src/objects.h
  M     src/objects.cc
  M     src/runtime-profiler.cc
  M     src/runtime.cc
  M     src/v8-counters.h


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to