Skip to content

Commit b1ec4cb

Browse files
littledanCommit bot
authored andcommitted
Do not penalize performance when --harmony-species is off
This patch ensures that the species protector does not cause any slow paths to be taken when --harmony-species is off by refraining from writing to and reading from the protector when the flag is off. BUG=chromium:606207 R=adamk LOG=Y Review URL: https://codereview.chromium.org/1918383002 Cr-Commit-Position: refs/heads/master@{#35800}
1 parent ea2fbb7 commit b1ec4cb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/isolate.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2554,6 +2554,7 @@ bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
25542554
}
25552555

25562556
bool Isolate::IsArraySpeciesLookupChainIntact() {
2557+
if (!FLAG_harmony_species) return true;
25572558
// Note: It would be nice to have debug checks to make sure that the
25582559
// species protector is accurate, but this would be hard to do for most of
25592560
// what the protector stands for:
@@ -2572,6 +2573,7 @@ bool Isolate::IsArraySpeciesLookupChainIntact() {
25722573
}
25732574

25742575
void Isolate::InvalidateArraySpeciesProtector() {
2576+
if (!FLAG_harmony_species) return;
25752577
DCHECK(factory()->species_protector()->value()->IsSmi());
25762578
DCHECK(IsArraySpeciesLookupChainIntact());
25772579
PropertyCell::SetValueWithInvalidation(

0 commit comments

Comments
 (0)