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

Unified Diff: src/modules.h

Issue 935723004: Rename Interface to ModuleDescriptor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months 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 | « src/mips64/full-codegen-mips64.cc ('k') | src/modules.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/modules.h
diff --git a/src/interface.h b/src/modules.h
similarity index 71%
rename from src/interface.h
rename to src/modules.h
index 9c6e2c34d1e06947185d79397f8d40ea7d129f3a..ac04e47c4d76c7d9179b6097d72d410a552ed5e6 100644
--- a/src/interface.h
+++ b/src/modules.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef V8_INTERFACE_H_
-#define V8_INTERFACE_H_
+#ifndef V8_MODULES_H_
+#define V8_MODULES_H_
#include "src/zone.h"
@@ -14,20 +14,19 @@ namespace internal {
class AstRawString;
-// This class represents the interface of a module: a set of exported names.
-//
-// TODO(adamk): Rename this to ModuleRecord, ModuleDescriptor, or similar.
-class Interface : public ZoneObject {
+class ModuleDescriptor : public ZoneObject {
public:
// ---------------------------------------------------------------------------
// Factory methods.
- static Interface* New(Zone* zone) { return new (zone) Interface(); }
+ static ModuleDescriptor* New(Zone* zone) {
+ return new (zone) ModuleDescriptor();
+ }
// ---------------------------------------------------------------------------
// Mutators.
- // Add a name to the list of exports. If it already exists, or this interface
+ // Add a name to the list of exports. If it already exists, or this descriptor
// is frozen, that's an error.
void Add(const AstRawString* name, Zone* zone, bool* ok);
@@ -62,8 +61,8 @@ class Interface : public ZoneObject {
// Iterators.
// Use like:
- // for (auto it = interface->iterator(); !it.done(); it.Advance()) {
- // ... it.name() ... it.interface() ...
+ // for (auto it = descriptor->iterator(); !it.done(); it.Advance()) {
+ // ... it.name() ...
// }
class Iterator {
public:
@@ -75,7 +74,7 @@ class Interface : public ZoneObject {
void Advance() { entry_ = exports_->Next(entry_); }
private:
- friend class Interface;
+ friend class ModuleDescriptor;
explicit Iterator(const ZoneHashMap* exports)
: exports_(exports), entry_(exports ? exports->Start() : NULL) {}
@@ -86,26 +85,15 @@ class Interface : public ZoneObject {
Iterator iterator() const { return Iterator(this->exports_); }
// ---------------------------------------------------------------------------
- // Debugging.
-#ifdef DEBUG
- void Print(int n = 0); // n = indentation; n < 0 => don't print recursively
-#endif
-
- // ---------------------------------------------------------------------------
// Implementation.
private:
bool frozen_;
ZoneHashMap* exports_; // Module exports and their types (allocated lazily)
int index_;
- Interface() : frozen_(false), exports_(NULL), index_(-1) {
-#ifdef DEBUG
- if (FLAG_print_interface_details)
- PrintF("# Creating %p\n", static_cast<void*>(this));
-#endif
- }
+ ModuleDescriptor() : frozen_(false), exports_(NULL), index_(-1) {}
};
} } // namespace v8::internal
-#endif // V8_INTERFACE_H_
+#endif // V8_MODULES_H_
« no previous file with comments | « src/mips64/full-codegen-mips64.cc ('k') | src/modules.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698