diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2016-04-10 09:28:39 +0000 |
commit | 32761a6cee1d0dee366b885b7b9c777e67885688 (patch) | |
tree | d6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysisInlines.h | |
parent | a4e969f4965059196ca948db781e52f7cfebf19e (diff) | |
download | WebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz |
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysisInlines.h')
-rw-r--r-- | Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysisInlines.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysisInlines.h b/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysisInlines.h index 9b5c755fc..8824bd85c 100644 --- a/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysisInlines.h +++ b/Source/JavaScriptCore/bytecode/BytecodeLivenessAnalysisInlines.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. + * Copyright (C) 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 @@ -28,26 +28,30 @@ #include "BytecodeLivenessAnalysis.h" #include "CodeBlock.h" -#include "Operations.h" namespace JSC { -inline bool operandIsAlwaysLive(int operand) +inline bool operandIsAlwaysLive(CodeBlock* codeBlock, int operand) { - return !VirtualRegister(operand).isLocal(); + if (VirtualRegister(operand).isArgument()) + return true; + return operand <= codeBlock->captureStart() && operand > codeBlock->captureEnd(); } -inline bool operandThatIsNotAlwaysLiveIsLive(const FastBitVector& out, int operand) +inline bool operandThatIsNotAlwaysLiveIsLive(CodeBlock* codeBlock, const FastBitVector& out, int operand) { - unsigned local = VirtualRegister(operand).toLocal(); - if (local >= out.numBits()) + VirtualRegister virtualReg(operand); + if (virtualReg.offset() > codeBlock->captureStart()) + return out.get(virtualReg.toLocal()); + size_t index = virtualReg.toLocal() - codeBlock->captureCount(); + if (index >= out.numBits()) return false; - return out.get(local); + return out.get(index); } -inline bool operandIsLive(const FastBitVector& out, int operand) +inline bool operandIsLive(CodeBlock* codeBlock, const FastBitVector& out, int operand) { - return operandIsAlwaysLive(operand) || operandThatIsNotAlwaysLiveIsLive(out, operand); + return operandIsAlwaysLive(codeBlock, operand) || operandThatIsNotAlwaysLiveIsLive(codeBlock, out, operand); } } // namespace JSC |