summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/common-node-cache.h
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-01-07 18:38:38 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2015-01-07 22:11:18 +0100
commitdad73f645cde6920e79db956e7ef82ed640d7615 (patch)
tree7ba3f3fc7e0722c5f130065461b7c56f571af383 /deps/v8/src/compiler/common-node-cache.h
parent53ba494537259b18b346dc6150d6a100c557e08f (diff)
downloadnode-new-dad73f645cde6920e79db956e7ef82ed640d7615.tar.gz
deps: upgrade v8 to 3.31.74.1
PR-URL: https://github.com/iojs/io.js/pull/243 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/common-node-cache.h')
-rw-r--r--deps/v8/src/compiler/common-node-cache.h42
1 files changed, 24 insertions, 18 deletions
diff --git a/deps/v8/src/compiler/common-node-cache.h b/deps/v8/src/compiler/common-node-cache.h
index 54795749d5..7ec70aea7e 100644
--- a/deps/v8/src/compiler/common-node-cache.h
+++ b/deps/v8/src/compiler/common-node-cache.h
@@ -5,57 +5,63 @@
#ifndef V8_COMPILER_COMMON_NODE_CACHE_H_
#define V8_COMPILER_COMMON_NODE_CACHE_H_
-#include "src/assembler.h"
#include "src/compiler/node-cache.h"
namespace v8 {
namespace internal {
+
+// Forward declarations.
+class ExternalReference;
+
+
namespace compiler {
// Bundles various caches for common nodes.
-class CommonNodeCache FINAL : public ZoneObject {
+class CommonNodeCache FINAL {
public:
explicit CommonNodeCache(Zone* zone) : zone_(zone) {}
+ ~CommonNodeCache() {}
Node** FindInt32Constant(int32_t value) {
- return int32_constants_.Find(zone_, value);
+ return int32_constants_.Find(zone(), value);
}
Node** FindInt64Constant(int64_t value) {
- return int64_constants_.Find(zone_, value);
+ return int64_constants_.Find(zone(), value);
+ }
+
+ Node** FindFloat32Constant(float value) {
+ // We canonicalize float constants at the bit representation level.
+ return float32_constants_.Find(zone(), bit_cast<int32_t>(value));
}
Node** FindFloat64Constant(double value) {
// We canonicalize double constants at the bit representation level.
- return float64_constants_.Find(zone_, bit_cast<int64_t>(value));
+ return float64_constants_.Find(zone(), bit_cast<int64_t>(value));
}
- Node** FindExternalConstant(ExternalReference reference) {
- return external_constants_.Find(zone_, reference.address());
- }
+ Node** FindExternalConstant(ExternalReference value);
Node** FindNumberConstant(double value) {
// We canonicalize double constants at the bit representation level.
- return number_constants_.Find(zone_, bit_cast<int64_t>(value));
+ return number_constants_.Find(zone(), bit_cast<int64_t>(value));
}
- Zone* zone() const { return zone_; }
+ // Return all nodes from the cache.
+ void GetCachedNodes(ZoneVector<Node*>* nodes);
- void GetCachedNodes(NodeVector* nodes) {
- int32_constants_.GetCachedNodes(nodes);
- int64_constants_.GetCachedNodes(nodes);
- float64_constants_.GetCachedNodes(nodes);
- external_constants_.GetCachedNodes(nodes);
- number_constants_.GetCachedNodes(nodes);
- }
+ Zone* zone() const { return zone_; }
private:
Int32NodeCache int32_constants_;
Int64NodeCache int64_constants_;
+ Int32NodeCache float32_constants_;
Int64NodeCache float64_constants_;
- PtrNodeCache external_constants_;
+ IntPtrNodeCache external_constants_;
Int64NodeCache number_constants_;
Zone* zone_;
+
+ DISALLOW_COPY_AND_ASSIGN(CommonNodeCache);
};
} // namespace compiler