Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Do not penalize performance when --harmony-species is off
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
littledan authored and Commit bot committed Apr 26, 2016
1 parent ea2fbb7 commit b1ec4cb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2554,6 +2554,7 @@ bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
}

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

void Isolate::InvalidateArraySpeciesProtector() {
if (!FLAG_harmony_species) return;
DCHECK(factory()->species_protector()->value()->IsSmi());
DCHECK(IsArraySpeciesLookupChainIntact());
PropertyCell::SetValueWithInvalidation(
Expand Down

0 comments on commit b1ec4cb

Please sign in to comment.