Create fewer local v8::TryCatch objects in generated bindings code
When converting constructor and method arguments, switch from generating
the equivalent of
float x;
{
v8::TryCatch block;
x = ...;
if (UNLIKELY(block.HasCaught()) {
block.ReThrow();
return;
}
}
float y;
{
v8::TryCatch block;
y = ...;
/* check result again, same as above */
}
to generating the equivalent of
float x;
float y;
{
v8::TryCatch block;
x = ...;
if (UNLIKELY(block.HasCaught()) {
block.ReThrow();
return;
}
y = ...;
/* check result again, same as above */
}
in order to avoid creating and destroying one v8::TryCatch object for each
argument.
This reduces the size of the final binary by about 20 kB (64-bit Linux) and
improves performance by up to 30 % on favorable micro-benchmarks (repeatedly
calling some DOM function that takes many primitive-typed arguments.)
R=haraken, nbarth
Review URL: https://codereview.chromium.org/265293004
git-svn-id: svn://svn.chromium.org/blink/trunk@174546 bbb929c8-8fbe-4397-9dbb-9b2b20218538
19 files changed