Commit b1ec4cb6 authored by littledan's avatar littledan Committed by Commit bot

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}
parent ea2fbb76
...@@ -2554,6 +2554,7 @@ bool Isolate::IsFastArrayConstructorPrototypeChainIntact() { ...@@ -2554,6 +2554,7 @@ bool Isolate::IsFastArrayConstructorPrototypeChainIntact() {
} }
bool Isolate::IsArraySpeciesLookupChainIntact() { bool Isolate::IsArraySpeciesLookupChainIntact() {
if (!FLAG_harmony_species) return true;
// Note: It would be nice to have debug checks to make sure that the // 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 // species protector is accurate, but this would be hard to do for most of
// what the protector stands for: // what the protector stands for:
...@@ -2572,6 +2573,7 @@ bool Isolate::IsArraySpeciesLookupChainIntact() { ...@@ -2572,6 +2573,7 @@ bool Isolate::IsArraySpeciesLookupChainIntact() {
} }
void Isolate::InvalidateArraySpeciesProtector() { void Isolate::InvalidateArraySpeciesProtector() {
if (!FLAG_harmony_species) return;
DCHECK(factory()->species_protector()->value()->IsSmi()); DCHECK(factory()->species_protector()->value()->IsSmi());
DCHECK(IsArraySpeciesLookupChainIntact()); DCHECK(IsArraySpeciesLookupChainIntact());
PropertyCell::SetValueWithInvalidation( PropertyCell::SetValueWithInvalidation(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment