Hi!
This is a simple code cleanup patch.
The constructor HashMap() creates an invalid HashMap object. It is
only used by dummy constructors as far as I see. So I removed the
dummy constructors and made HashMap() private. Now there will be
compiler errors instead of runtime errors if HashMap() is used.
This is the output of svn diff:
Index: src/hashmap.h
===================================================================
--- src/hashmap.h (revision 8723)
+++ src/hashmap.h (arbetskopia)
@@ -45,16 +45,17 @@
class HashMap {
+ private:
+ // Dummy constructor. This constructor doesn't set up the hash
+ // map properly so don't use it unless you have good reason (e.g.,
+ // you know that the HashMap will never be used).
+ HashMap();
+
public:
static Allocator DefaultAllocator;
typedef bool (*MatchFun) (void* key1, void* key2);
- // Dummy constructor. This constructor doesn't set up the hash
- // map properly so don't use it unless you have good reason (e.g.,
- // you know that the HashMap will never be used).
- HashMap();
-
// initial_capacity is the size of the initial hash map;
// it must be a power of 2 (and thus must not be 0).
explicit HashMap(MatchFun match,
Index: src/hashmap.cc
===================================================================
--- src/hashmap.cc (revision 8723)
+++ src/hashmap.cc (arbetskopia)
@@ -38,13 +38,6 @@
Allocator HashMap::DefaultAllocator;
-
-HashMap::HashMap() {
- allocator_ = NULL;
- match_ = NULL;
-}
-
-
HashMap::HashMap(MatchFun match,
Allocator* allocator,
uint32_t initial_capacity) {
Index: src/scopes.h
===================================================================
--- src/scopes.h (revision 8723)
+++ src/scopes.h (arbetskopia)
@@ -42,10 +42,6 @@
public:
VariableMap();
- // Dummy constructor. This constructor doesn't set up the map
- // properly so don't use it unless you have a good reason.
- explicit VariableMap(bool gotta_love_static_overloading);
-
virtual ~VariableMap();
Variable* Declare(Scope* scope,
@@ -317,8 +313,6 @@
protected:
friend class ParserFactory;
- explicit Scope(Type type);
-
Isolate* const isolate_;
// Scope tree.
Index: src/scopes.cc
===================================================================
--- src/scopes.cc (revision 8723)
+++ src/scopes.cc (arbetskopia)
@@ -77,9 +77,6 @@
}
-// Dummy constructor
-VariableMap::VariableMap(bool gotta_love_static_overloading) :
HashMap() {}
-
VariableMap::VariableMap() : HashMap(Match, &LocalsMapAllocator, 8)
{}
VariableMap::~VariableMap() {}
@@ -113,21 +110,6 @@
//
----------------------------------------------------------------------------
// Implementation of Scope
-
-// Dummy constructor
-Scope::Scope(Type type)
- : isolate_(Isolate::Current()),
- inner_scopes_(0),
- variables_(false),
- temps_(0),
- params_(0),
- unresolved_(0),
- decls_(0),
- already_resolved_(false) {
- SetDefaults(type, NULL, Handle<SerializedScopeInfo>::null());
-}
-
-
Scope::Scope(Scope* outer_scope, Type type)
: isolate_(Isolate::Current()),
inner_scopes_(4),
I have tried to upload this for review with gcl but it failed.
The first command seemed to work:
daniel@daniel-VirtualBox:~/v8$ gcl change mychange
WARNING: Creating CL in a read-only checkout. You will not be able to
commit it!
mychange changelist saved.
But I get a warning when I try gcl upload:
daniel@daniel-VirtualBox:~/v8$ gcl upload mychange
Nothing to upload, changelist is empty.
I'd like to know if I do something wrong with the gcl?
Best regards,
Daniel Marjamäki
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev