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

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: Rebase again. Created 5 years, 3 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/object-observe.js ('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 869253741702f8596dd45b59517bb816437b3414..0c9a6d20f0d29cd7e66f33d9f8f9b78d264f1a96 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1016,7 +1016,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);
@@ -1025,7 +1029,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.
@@ -1107,6 +1110,9 @@ class Object {
MUST_USE_RESULT static MaybeHandle<Object> GetMethod(
Handle<JSReceiver> receiver, Handle<Name> name);
+ // 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);
@@ -5233,7 +5239,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> {};
@@ -5268,7 +5274,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();
@@ -5291,6 +5297,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);
@@ -5466,8 +5477,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);
@@ -5716,7 +5725,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;
@@ -9298,7 +9307,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)
« no previous file with comments | « src/object-observe.js ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698