Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 37516131cf3d595b80b995fe1502d0a3d3131920..cd8bfe78dd28487a942cab5fa6619ac121b739d1 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -1535,7 +1535,10 @@ class Object : public MaybeObject { |
MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( |
Handle<Object> object, |
Handle<Name> key); |
- |
+ MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( |
+ Isolate* isolate, |
+ Handle<Object> object, |
+ const char* key); |
MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( |
Handle<Object> object, |
Handle<Name> key); |
@@ -2108,6 +2111,14 @@ class JSReceiver: public HeapObject { |
bool search_hidden_prototypes = false); |
void Lookup(Name* name, LookupResult* result); |
+ enum KeyCollectionType { LOCAL_ONLY, INCLUDE_PROTOS }; |
+ |
+ // Computes the enumerable keys for a JSObject. Used for implementing |
+ // "for (n in object) { }". |
+ MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( |
+ Handle<JSReceiver> object, |
+ KeyCollectionType type); |
+ |
protected: |
Smi* GenerateIdentityHash(); |
@@ -2523,6 +2534,15 @@ class JSObject: public JSReceiver { |
inline bool HasNamedInterceptor(); |
inline bool HasIndexedInterceptor(); |
+ // Computes the enumerable keys from interceptors. Used for debug mirrors and |
+ // by JSReceiver::GetKeys. |
+ MUST_USE_RESULT static MaybeHandle<JSArray> GetKeysForNamedInterceptor( |
+ Handle<JSObject> object, |
+ Handle<JSReceiver> receiver); |
+ MUST_USE_RESULT static MaybeHandle<JSArray> GetKeysForIndexedInterceptor( |
+ Handle<JSObject> object, |
+ Handle<JSReceiver> receiver); |
+ |
// Support functions for v8 api (needed for correct interceptor behavior). |
static bool HasRealNamedProperty(Handle<JSObject> object, |
Handle<Name> key); |
@@ -6839,6 +6859,22 @@ class Script: public Struct { |
// resource is accessible. Otherwise, always return true. |
inline bool HasValidSource(); |
+ // Convert code position into column number. |
+ static int GetColumnNumber(Handle<Script> script, int code_pos); |
+ |
+ // Convert code position into (zero-based) line number. |
+ // The non-handlified version does not allocate, but may be much slower. |
+ static int GetLineNumber(Handle<Script> script, int code_pos); |
+ int GetLineNumber(int code_pos); |
+ |
+ static Handle<Object> GetNameOrSourceURL(Handle<Script> script); |
+ |
+ // Init line_ends array with code positions of line ends inside script source. |
+ static void InitLineEnds(Handle<Script> script); |
+ |
+ // Get the JS object wrapping the given script; create it if none exists. |
+ static Handle<JSObject> GetWrapper(Handle<Script> script); |
+ |
// Dispatched behavior. |
DECLARE_PRINTER(Script) |
DECLARE_VERIFIER(Script) |
@@ -6860,6 +6896,8 @@ class Script: public Struct { |
static const int kSize = kFlagsOffset + kPointerSize; |
private: |
+ int GetLineNumberWithArray(int code_pos); |
+ |
// Bit positions in the flags field. |
static const int kCompilationTypeBit = 0; |
static const int kCompilationStateBit = 1; |
@@ -9229,6 +9267,9 @@ class String: public Name { |
return VisitFlat(visitor, string, offset, string->length(), type); |
} |
+ static Handle<FixedArray> CalculateLineEnds(Handle<String> string, |
+ bool include_ending_line); |
+ |
private: |
friend class Name; |