diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-05-30 12:48:17 +0200 |
commit | 881da28418d380042aa95a97f0cbd42560a64f7c (patch) | |
tree | a794dff3274695e99c651902dde93d934ea7a5af /Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp | |
parent | 7e104c57a70fdf551bb3d22a5d637cdcbc69dbea (diff) | |
parent | 0fcedcd17cc00d3dd44c718b3cb36c1033319671 (diff) | |
download | qtwebkit-881da28418d380042aa95a97f0cbd42560a64f7c.tar.gz |
Merge 'wip/next' into dev
Change-Id: Iff9ee5e23bb326c4371ec8ed81d56f2f05d680e9
Diffstat (limited to 'Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp')
-rw-r--r-- | Source/JavaScriptCore/bytecode/LazyOperandValueProfile.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
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<LazyOperandValueProfile::List>(); 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) - |