diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-05-20 09:56:07 +0000 |
commit | 41386e9cb918eed93b3f13648cbef387e371e451 (patch) | |
tree | a97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp | |
parent | e15dd966d523731101f70ccf768bba12435a0208 (diff) | |
download | WebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz |
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp b/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp index e3f413c3b..98e08f6ff 100644 --- a/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp +++ b/Source/JavaScriptCore/dfg/DFGVariableEventStream.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2015 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 @@ -31,7 +31,7 @@ #include "CodeBlock.h" #include "DFGJITCode.h" #include "DFGValueSource.h" -#include "JSCInlines.h" +#include "Operations.h" #include <wtf/DataLog.h> #include <wtf/HashMap.h> @@ -48,14 +48,11 @@ namespace { struct MinifiedGenerationInfo { bool filled; // true -> in gpr/fpr/pair, false -> spilled - bool alive; VariableRepresentation u; DataFormat format; MinifiedGenerationInfo() - : filled(false) - , alive(false) - , format(DataFormatNone) + : format(DataFormatNone) { } @@ -65,19 +62,13 @@ struct MinifiedGenerationInfo { case BirthToFill: case Fill: filled = true; - alive = true; break; case BirthToSpill: case Spill: filled = false; - alive = true; break; - case Birth: - alive = true; - return; case Death: format = DataFormatNone; - alive = false; return; default: return; @@ -90,23 +81,25 @@ struct MinifiedGenerationInfo { } // namespace -bool VariableEventStream::tryToSetConstantRecovery(ValueRecovery& recovery, MinifiedNode* node) const +bool VariableEventStream::tryToSetConstantRecovery(ValueRecovery& recovery, CodeBlock* codeBlock, MinifiedNode* node) const { if (!node) return false; - if (node->hasConstant()) { - recovery = ValueRecovery::constant(node->constant()); + if (node->hasConstantNumber()) { + recovery = ValueRecovery::constant( + codeBlock->constantRegister( + FirstConstantRegisterIndex + node->constantNumber()).get()); return true; } - if (node->op() == PhantomDirectArguments) { - recovery = ValueRecovery::directArgumentsThatWereNotCreated(node->id()); + if (node->hasWeakConstant()) { + recovery = ValueRecovery::constant(node->weakConstant()); return true; } - if (node->op() == PhantomClonedArguments) { - recovery = ValueRecovery::outOfBandArgumentsThatWereNotCreated(node->id()); + if (node->op() == PhantomArguments) { + recovery = ValueRecovery::argumentsThatWereNotCreated(); return true; } @@ -155,8 +148,7 @@ void VariableEventStream::reconstruct( // nothing to do. break; case BirthToFill: - case BirthToSpill: - case Birth: { + case BirthToSpill: { MinifiedGenerationInfo info; info.update(event); generationInfos.add(event.id(), info); @@ -195,14 +187,14 @@ void VariableEventStream::reconstruct( ASSERT(source.kind() == HaveNode); MinifiedNode* node = graph.at(source.id()); + if (tryToSetConstantRecovery(valueRecoveries[i], codeBlock, node)) + continue; + MinifiedGenerationInfo info = generationInfos.get(source.id()); - if (!info.alive) { + if (info.format == DataFormatNone) { valueRecoveries[i] = ValueRecovery::constant(jsUndefined()); continue; } - - if (tryToSetConstantRecovery(valueRecoveries[i], node)) - continue; ASSERT(info.format != DataFormatNone); |