.class public final Lz5/qw;
.super Lz5/n50;
.source ""


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lz5/n50<",
        "Lz5/iw;",
        ">;"
    }
.end annotation


# instance fields
.field public final u:Ljava/lang/Object;

.field public final v:Lcom/google/android/gms/ads/internal/util/zzbe;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/google/android/gms/ads/internal/util/zzbe<",
            "Lz5/iw;",
            ">;"
        }
    .end annotation
.end field

.field public w:Z

.field public x:I


# direct methods
.method public constructor <init>(Lcom/google/android/gms/ads/internal/util/zzbe;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/google/android/gms/ads/internal/util/zzbe<",
            "Lz5/iw;",
            ">;)V"
        }
    .end annotation

    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lz5/n50;-><init>(I)V

    new-instance v1, Ljava/lang/Object;

    invoke-direct {v1}, Ljava/lang/Object;-><init>()V

    iput-object v1, p0, Lz5/qw;->u:Ljava/lang/Object;

    iput-object p1, p0, Lz5/qw;->v:Lcom/google/android/gms/ads/internal/util/zzbe;

    iput-boolean v0, p0, Lz5/qw;->w:Z

    iput v0, p0, Lz5/qw;->x:I

    return-void
.end method


# virtual methods
.method public final k()V
    .registers 4

    iget-object v0, p0, Lz5/qw;->u:Ljava/lang/Object;

    monitor-enter v0

    :try_start_3
    iget v1, p0, Lz5/qw;->x:I

    const/4 v2, 0x1

    if-ltz v1, :cond_a

    move v1, v2

    goto :goto_b

    :cond_a
    const/4 v1, 0x0

    :goto_b
    invoke-static {v1}, Lcom/google/android/gms/common/internal/d;->j(Z)V

    const-string v1, "Releasing root reference. JS Engine will be destroyed once other references are released."

    invoke-static {v1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    iput-boolean v2, p0, Lz5/qw;->w:Z

    invoke-virtual {p0}, Lz5/qw;->q()V

    monitor-exit v0

    return-void

    :catchall_1a
    move-exception v1

    monitor-exit v0
    :try_end_1c
    .catchall {:try_start_3 .. :try_end_1c} :catchall_1a

    throw v1
.end method

.method public final o()Lz5/pw;
    .registers 5

    new-instance v0, Lz5/pw;

    invoke-direct {v0, p0}, Lz5/pw;-><init>(Lz5/qw;)V

    iget-object v1, p0, Lz5/qw;->u:Ljava/lang/Object;

    monitor-enter v1

    :try_start_8
    new-instance v2, Lz5/xa0;

    invoke-direct {v2, v0}, Lz5/xa0;-><init>(Lz5/pw;)V

    new-instance v3, Lz5/bd0;

    invoke-direct {v3, v0}, Lz5/bd0;-><init>(Lz5/pw;)V

    invoke-virtual {p0, v2, v3}, Lz5/n50;->l(Lz5/m50;Lz5/l50;)V

    iget v2, p0, Lz5/qw;->x:I

    const/4 v3, 0x1

    if-ltz v2, :cond_1c

    move v2, v3

    goto :goto_1d

    :cond_1c
    const/4 v2, 0x0

    :goto_1d
    invoke-static {v2}, Lcom/google/android/gms/common/internal/d;->j(Z)V

    iget v2, p0, Lz5/qw;->x:I

    add-int/2addr v2, v3

    iput v2, p0, Lz5/qw;->x:I

    monitor-exit v1

    return-object v0

    :catchall_27
    move-exception v0

    monitor-exit v1
    :try_end_29
    .catchall {:try_start_8 .. :try_end_29} :catchall_27

    throw v0
.end method

.method public final p()V
    .registers 3

    iget-object v0, p0, Lz5/qw;->u:Ljava/lang/Object;

    monitor-enter v0

    :try_start_3
    iget v1, p0, Lz5/qw;->x:I

    if-lez v1, :cond_9

    const/4 v1, 0x1

    goto :goto_a

    :cond_9
    const/4 v1, 0x0

    :goto_a
    invoke-static {v1}, Lcom/google/android/gms/common/internal/d;->j(Z)V

    const-string v1, "Releasing 1 reference for JS Engine"

    invoke-static {v1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    iget v1, p0, Lz5/qw;->x:I

    add-int/lit8 v1, v1, -0x1

    iput v1, p0, Lz5/qw;->x:I

    invoke-virtual {p0}, Lz5/qw;->q()V

    monitor-exit v0

    return-void

    :catchall_1d
    move-exception v1

    monitor-exit v0
    :try_end_1f
    .catchall {:try_start_3 .. :try_end_1f} :catchall_1d

    throw v1
.end method

.method public final q()V
    .registers 5

    iget-object v0, p0, Lz5/qw;->u:Ljava/lang/Object;

    monitor-enter v0

    :try_start_3
    iget v1, p0, Lz5/qw;->x:I

    if-ltz v1, :cond_9

    const/4 v1, 0x1

    goto :goto_a

    :cond_9
    const/4 v1, 0x0

    :goto_a
    invoke-static {v1}, Lcom/google/android/gms/common/internal/d;->j(Z)V

    iget-boolean v1, p0, Lz5/qw;->w:Z

    if-eqz v1, :cond_29

    iget v1, p0, Lz5/qw;->x:I

    if-nez v1, :cond_29

    const-string v1, "No reference is left (including root). Cleaning up engine."

    invoke-static {v1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    new-instance v1, Lz5/ge0;

    invoke-direct {v1, p0}, Lz5/ge0;-><init>(Lz5/qw;)V

    new-instance v2, Ly2/b;

    const/4 v3, 0x5

    invoke-direct {v2, v3}, Ly2/b;-><init>(I)V

    invoke-virtual {p0, v1, v2}, Lz5/n50;->l(Lz5/m50;Lz5/l50;)V

    goto :goto_2e

    :cond_29
    const-string v1, "There are still references to the engine. Not destroying."

    invoke-static {v1}, Lcom/google/android/gms/ads/internal/util/zze;->zza(Ljava/lang/String;)V

    :goto_2e
    monitor-exit v0

    return-void

    :catchall_30
    move-exception v1

    monitor-exit v0
    :try_end_32
    .catchall {:try_start_3 .. :try_end_32} :catchall_30

    throw v1
.end method
