Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: src/compiler/common-node-cache.h

Issue 822923002: [turbofan] Cache float32 constants on the JSGraph level. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/compiler/common-node-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-node-cache.h
diff --git a/src/compiler/common-node-cache.h b/src/compiler/common-node-cache.h
index 54795749d520082337ddc8ff153e128c341741a4..7ec70aea7e352e35cbb2084c905eb48f02cd5162 100644
--- a/src/compiler/common-node-cache.h
+++ b/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
« no previous file with comments | « BUILD.gn ('k') | src/compiler/common-node-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698