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

Unified Diff: src/objects.h

Issue 1316933002: [es6] Initial steps towards a correct implementation of IsCallable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: ia32, arm and arm64 ports. Misc cleanups. Created 5 years, 4 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
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index a0ca513dd9e249046150fd2888c38a914e9c887d..30d363c6308717f79b427a4b3751982225e55143 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1006,7 +1006,11 @@ class Object {
STRUCT_LIST(DECLARE_STRUCT_PREDICATE)
#undef DECLARE_STRUCT_PREDICATE
+ // ES6, section 7.2.3 IsCallable.
+ INLINE(bool IsCallable() const);
+
INLINE(bool IsSpecObject()) const;
+ // TODO(rossberg): IsSpecFunction should be removed in favor of IsCallable.
INLINE(bool IsSpecFunction()) const;
INLINE(bool IsTemplateInfo()) const;
INLINE(bool IsNameDictionary() const);
@@ -1015,7 +1019,6 @@ class Object {
INLINE(bool IsUnseededNumberDictionary() const);
INLINE(bool IsOrderedHashSet() const);
INLINE(bool IsOrderedHashMap() const);
- bool IsCallable() const;
static bool IsPromise(Handle<Object> object);
// Oddball testing.
@@ -1078,6 +1081,9 @@ class Object {
Handle<Object> object,
Handle<Context> context);
+ // ES6 section 12.5.6 The typeof Operator
+ static Handle<String> TypeOf(Isolate* isolate, Handle<Object> object);
+
MUST_USE_RESULT static MaybeHandle<Object> GetProperty(
LookupIterator* it, LanguageMode language_mode = SLOPPY);
@@ -5186,7 +5192,7 @@ class Map: public HeapObject {
STATIC_ASSERT(kDescriptorIndexBitCount + kDescriptorIndexBitCount == 20);
class DictionaryMap : public BitField<bool, 20, 1> {};
class OwnsDescriptors : public BitField<bool, 21, 1> {};
- class HasInstanceCallHandler : public BitField<bool, 22, 1> {};
+ class IsHiddenPrototype : public BitField<bool, 22, 1> {};
class Deprecated : public BitField<bool, 23, 1> {};
class IsUnstable : public BitField<bool, 24, 1> {};
class IsMigrationTarget : public BitField<bool, 25, 1> {};
@@ -5221,7 +5227,7 @@ class Map: public HeapObject {
// Tells whether the instance with this map should be ignored by the
// Object.getPrototypeOf() function and the __proto__ accessor.
inline void set_is_hidden_prototype();
- inline bool is_hidden_prototype();
+ inline bool is_hidden_prototype() const;
// Records and queries whether the instance has a named interceptor.
inline void set_has_named_interceptor();
@@ -5244,6 +5250,11 @@ class Map: public HeapObject {
inline void set_is_observed();
inline bool is_observed();
+ // Tells whether the instance has a [[Call]] internal field.
+ // This property is implemented according to ES6, section 7.2.3.
+ inline void set_is_callable();
+ inline bool is_callable() const;
+
inline void set_is_strong();
inline bool is_strong();
inline void set_is_extensible(bool value);
@@ -5419,8 +5430,6 @@ class Map: public HeapObject {
inline bool owns_descriptors();
inline void set_owns_descriptors(bool owns_descriptors);
- inline bool has_instance_call_handler();
- inline void set_has_instance_call_handler();
inline void mark_unstable();
inline bool is_stable();
inline void set_migration_target(bool value);
@@ -5669,7 +5678,7 @@ class Map: public HeapObject {
// Bit positions for bit field.
static const int kHasNonInstancePrototype = 0;
- static const int kIsHiddenPrototype = 1;
+ static const int kIsCallable = 1;
static const int kHasNamedInterceptor = 2;
static const int kHasIndexedInterceptor = 3;
static const int kIsUndetectable = 4;
@@ -9254,7 +9263,7 @@ class JSProxy: public JSReceiver {
class JSFunctionProxy: public JSProxy {
public:
// [call_trap]: The call trap.
- DECL_ACCESSORS(call_trap, Object)
+ DECL_ACCESSORS(call_trap, JSReceiver)
// [construct_trap]: The construct trap.
DECL_ACCESSORS(construct_trap, Object)

Powered by Google App Engine
This is Rietveld 408576698