Chromium Code Reviews
DescriptionCreate 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
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=174546
Patch Set 1 #
Total comments: 22
Patch Set 2 : address most comments #Patch Set 3 : rebased #Patch Set 4 : avoid some unused v8::TryCatch objects #
Total comments: 17
Patch Set 5 : address nits #Patch Set 6 : simplify 'cpp_type' generation #
Total comments: 1
Patch Set 7 : unwrap line #Patch Set 8 : rebased #Patch Set 9 : call block.ReThrow() when throwing exceptions #
Total comments: 1
Patch Set 10 : rebased #Patch Set 11 : add another missing ReThrow() #Patch Set 12 : rebased #
Total comments: 4
Patch Set 13 : added comment #Messages
Total messages: 53 (0 generated)
|