From 6882a04fb36642862b11efe514251d32070c3d65 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 25 Aug 2016 19:20:41 +0300 Subject: Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443) Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev --- .../bytecode/LazyOperandValueProfile.cpp | 36 ++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp') diff --git a/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp b/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp index 97b8f3bcd..de654db68 100644 --- a/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp +++ b/Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,29 +26,27 @@ #include "config.h" #include "LazyOperandValueProfile.h" -#if ENABLE(VALUE_PROFILER) - -#include "Operations.h" +#include "JSCInlines.h" namespace JSC { CompressedLazyOperandValueProfileHolder::CompressedLazyOperandValueProfileHolder() { } CompressedLazyOperandValueProfileHolder::~CompressedLazyOperandValueProfileHolder() { } -void CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions(OperationInProgress operation) +void CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions(const ConcurrentJITLocker& locker) { if (!m_data) return; for (unsigned i = 0; i < m_data->size(); ++i) - m_data->at(i).computeUpdatedPrediction(operation); + m_data->at(i).computeUpdatedPrediction(locker); } LazyOperandValueProfile* CompressedLazyOperandValueProfileHolder::add( - const LazyOperandValueProfileKey& key) + const ConcurrentJITLocker&, const LazyOperandValueProfileKey& key) { if (!m_data) - m_data = adoptPtr(new LazyOperandValueProfile::List()); + m_data = std::make_unique(); else { for (unsigned i = 0; i < m_data->size(); ++i) { if (m_data->at(i).key() == key) @@ -60,20 +58,22 @@ LazyOperandValueProfile* CompressedLazyOperandValueProfileHolder::add( return &m_data->last(); } -LazyOperandValueProfileParser::LazyOperandValueProfileParser( - CompressedLazyOperandValueProfileHolder& holder) - : m_holder(holder) +LazyOperandValueProfileParser::LazyOperandValueProfileParser() { } +LazyOperandValueProfileParser::~LazyOperandValueProfileParser() { } + +void LazyOperandValueProfileParser::initialize( + const ConcurrentJITLocker&, CompressedLazyOperandValueProfileHolder& holder) { - if (!m_holder.m_data) + ASSERT(m_map.isEmpty()); + + if (!holder.m_data) return; - LazyOperandValueProfile::List& data = *m_holder.m_data; + LazyOperandValueProfile::List& data = *holder.m_data; for (unsigned i = 0; i < data.size(); ++i) m_map.add(data[i].key(), &data[i]); } -LazyOperandValueProfileParser::~LazyOperandValueProfileParser() { } - LazyOperandValueProfile* LazyOperandValueProfileParser::getIfPresent( const LazyOperandValueProfileKey& key) const { @@ -87,16 +87,14 @@ LazyOperandValueProfile* LazyOperandValueProfileParser::getIfPresent( } SpeculatedType LazyOperandValueProfileParser::prediction( - const LazyOperandValueProfileKey& key) const + const ConcurrentJITLocker& locker, const LazyOperandValueProfileKey& key) const { LazyOperandValueProfile* profile = getIfPresent(key); if (!profile) return SpecNone; - return profile->computeUpdatedPrediction(); + return profile->computeUpdatedPrediction(locker); } } // namespace JSC -#endif // ENABLE(VALUE_PROFILER) - -- cgit v1.2.1