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

Unified Diff: src/objects.h

Issue 639123009: Classes: Add basic support for properties (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git rebase Created 6 years, 2 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/mksnapshot.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index af6bb667e16863aefb33957aa22710afc5c5234d..6ecbdf2d8b26717a0d7df679081b556293621de2 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1640,9 +1640,6 @@ class JSReceiver: public HeapObject {
MUST_USE_RESULT static inline Maybe<PropertyAttributes>
GetOwnElementAttribute(Handle<JSReceiver> object, uint32_t index);
- // Return the constructor function (may be Heap::null_value()).
- inline Object* GetConstructor();
-
// Retrieves a permanent object identity hash code. The undefined value might
// be returned in case no hash was created yet.
inline Object* GetIdentityHash();
@@ -1856,10 +1853,6 @@ class JSObject: public JSReceiver {
Handle<Object> receiver,
Handle<Name> name);
- // Returns true if this is an instance of an api function and has
- // been modified since it was created. May give false positives.
- bool IsDirty();
-
// Accessors for hidden properties object.
//
// Hidden properties are not own properties of the object itself.
@@ -2236,11 +2229,6 @@ class JSObject: public JSReceiver {
Handle<Map> new_map,
int expected_additional_properties);
- static void GeneralizeFieldRepresentation(Handle<JSObject> object,
- int modify_index,
- Representation new_representation,
- Handle<HeapType> new_field_type);
-
static void UpdateAllocationSite(Handle<JSObject> object,
ElementsKind to_kind);
@@ -3063,6 +3051,9 @@ class DescriptorArray: public FixedArray {
static const int kDescriptorSize = 3;
#ifdef OBJECT_PRINT
+ // For our gdb macros, we should perhaps change these in the future.
+ void Print();
+
// Print all the descriptors.
void PrintDescriptors(std::ostream& os); // NOLINT
#endif
@@ -3458,6 +3449,8 @@ class StringTable: public HashTable<StringTable,
uint16_t c1,
uint16_t c2);
+ static void EnsureCapacityForDeserialization(Isolate* isolate, int expected);
+
DECLARE_CAST(StringTable)
private:
@@ -3557,6 +3550,10 @@ class Dictionary: public HashTable<Derived, Shape, Key> {
// Returns the number of enumerable elements in the dictionary.
int NumberOfEnumElements();
+ // Returns true if the dictionary contains any elements that are non-writable,
+ // non-configurable, non-enumerable, or have getters/setters.
+ bool HasComplexElements();
+
enum SortMode { UNSORTED, SORTED };
// Copies keys to preallocated fixed array.
void CopyKeysTo(FixedArray* storage,
@@ -5150,6 +5147,10 @@ class Code: public HeapObject {
inline void set_profiler_ticks(int ticks);
// [builtin_index]: For BUILTIN kind, tells which builtin index it has.
+ // For builtins, tells which builtin index it has.
+ // Note that builtins can have a code kind other than BUILTIN, which means
+ // that for arbitrary code objects, this index value may be random garbage.
+ // To verify in that case, compare the code object to the indexed builtin.
inline int builtin_index();
inline void set_builtin_index(int id);
@@ -8127,7 +8128,6 @@ class TypeFeedbackInfo: public Struct {
inline void set_inlined_type_change_checksum(int checksum);
inline bool matches_inlined_type_change_checksum(int checksum);
-
DECLARE_CAST(TypeFeedbackInfo)
// Dispatched behavior.
@@ -8652,10 +8652,14 @@ class Symbol: public Name {
typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor;
+ void SymbolShortPrint(std::ostream& os);
+
private:
static const int kPrivateBit = 0;
static const int kOwnBit = 1;
+ const char* PrivateSymbolToName() const;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol);
};
@@ -9350,26 +9354,13 @@ class FlatStringReader : public Relocatable {
};
-// A ConsStringOp that returns null.
-// Useful when the operation to apply on a ConsString
-// requires an expensive data structure.
-class ConsStringNullOp {
- public:
- inline ConsStringNullOp() {}
- static inline String* Operate(String*, unsigned*, int32_t*, unsigned*);
- private:
- DISALLOW_COPY_AND_ASSIGN(ConsStringNullOp);
-};
-
-
// This maintains an off-stack representation of the stack frames required
// to traverse a ConsString, allowing an entirely iterative and restartable
// traversal of the entire string
-class ConsStringIteratorOp {
+class ConsStringIterator {
public:
- inline ConsStringIteratorOp() {}
- inline explicit ConsStringIteratorOp(ConsString* cons_string,
- int offset = 0) {
+ inline ConsStringIterator() {}
+ inline explicit ConsStringIterator(ConsString* cons_string, int offset = 0) {
Reset(cons_string, offset);
}
inline void Reset(ConsString* cons_string, int offset = 0) {
@@ -9409,14 +9400,13 @@ class ConsStringIteratorOp {
int depth_;
int maximum_depth_;
int consumed_;
- DISALLOW_COPY_AND_ASSIGN(ConsStringIteratorOp);
+ DISALLOW_COPY_AND_ASSIGN(ConsStringIterator);
};
class StringCharacterStream {
public:
inline StringCharacterStream(String* string,
- ConsStringIteratorOp* op,
int offset = 0);
inline uint16_t GetNext();
inline bool HasMore();
@@ -9425,13 +9415,13 @@ class StringCharacterStream {
inline void VisitTwoByteString(const uint16_t* chars, int length);
private:
+ ConsStringIterator iter_;
bool is_one_byte_;
union {
const uint8_t* buffer8_;
const uint16_t* buffer16_;
};
const uint8_t* end_;
- ConsStringIteratorOp* op_;
DISALLOW_COPY_AND_ASSIGN(StringCharacterStream);
};
@@ -9592,14 +9582,16 @@ class PropertyCell: public Cell {
class WeakCell : public HeapObject {
public:
- inline HeapObject* value() const;
+ inline Object* value() const;
// This should not be called by anyone except GC.
- inline void clear(HeapObject* undefined);
+ inline void clear();
// This should not be called by anyone except allocator.
inline void initialize(HeapObject* value);
+ inline bool cleared() const;
+
DECL_ACCESSORS(next, Object)
DECLARE_CAST(WeakCell)
« no previous file with comments | « src/mksnapshot.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698