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

Side by Side Diff: src/objects.h

Issue 1481613003: [Proxies] Support constructable proxy as new.target (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 public: 1793 public:
1794 DECLARE_CAST(JSReceiver) 1794 DECLARE_CAST(JSReceiver)
1795 1795
1796 // ES6 section 7.1.1 ToPrimitive 1796 // ES6 section 7.1.1 ToPrimitive
1797 MUST_USE_RESULT static MaybeHandle<Object> ToPrimitive( 1797 MUST_USE_RESULT static MaybeHandle<Object> ToPrimitive(
1798 Handle<JSReceiver> receiver, 1798 Handle<JSReceiver> receiver,
1799 ToPrimitiveHint hint = ToPrimitiveHint::kDefault); 1799 ToPrimitiveHint hint = ToPrimitiveHint::kDefault);
1800 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive( 1800 MUST_USE_RESULT static MaybeHandle<Object> OrdinaryToPrimitive(
1801 Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint); 1801 Handle<JSReceiver> receiver, OrdinaryToPrimitiveHint hint);
1802 1802
1803 static MaybeHandle<Context> GetFunctionRealm(Handle<JSReceiver> receiver);
1804
1803 // Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6. 1805 // Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6.
1804 MUST_USE_RESULT static Maybe<bool> HasProperty(LookupIterator* it); 1806 MUST_USE_RESULT static Maybe<bool> HasProperty(LookupIterator* it);
1805 MUST_USE_RESULT static inline Maybe<bool> HasProperty( 1807 MUST_USE_RESULT static inline Maybe<bool> HasProperty(
1806 Handle<JSReceiver> object, Handle<Name> name); 1808 Handle<JSReceiver> object, Handle<Name> name);
1807 MUST_USE_RESULT static inline Maybe<bool> HasOwnProperty(Handle<JSReceiver>, 1809 MUST_USE_RESULT static inline Maybe<bool> HasOwnProperty(Handle<JSReceiver>,
1808 Handle<Name> name); 1810 Handle<Name> name);
1809 MUST_USE_RESULT static inline Maybe<bool> HasElement( 1811 MUST_USE_RESULT static inline Maybe<bool> HasElement(
1810 Handle<JSReceiver> object, uint32_t index); 1812 Handle<JSReceiver> object, uint32_t index);
1811 MUST_USE_RESULT static inline Maybe<bool> HasOwnElement( 1813 MUST_USE_RESULT static inline Maybe<bool> HasOwnElement(
1812 Handle<JSReceiver> object, uint32_t index); 1814 Handle<JSReceiver> object, uint32_t index);
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 // properties is a FixedArray in the fast case and a Dictionary in the 1950 // properties is a FixedArray in the fast case and a Dictionary in the
1949 // slow case. 1951 // slow case.
1950 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties. 1952 DECL_ACCESSORS(properties, FixedArray) // Get and set fast properties.
1951 inline void initialize_properties(); 1953 inline void initialize_properties();
1952 inline bool HasFastProperties(); 1954 inline bool HasFastProperties();
1953 // Gets slow properties for non-global objects. 1955 // Gets slow properties for non-global objects.
1954 inline NameDictionary* property_dictionary(); 1956 inline NameDictionary* property_dictionary();
1955 // Gets global object properties. 1957 // Gets global object properties.
1956 inline GlobalDictionary* global_dictionary(); 1958 inline GlobalDictionary* global_dictionary();
1957 1959
1960 static MaybeHandle<Context> GetFunctionRealm(Handle<JSObject> object);
1961
1958 // [elements]: The elements (properties with names that are integers). 1962 // [elements]: The elements (properties with names that are integers).
1959 // 1963 //
1960 // Elements can be in two general modes: fast and slow. Each mode 1964 // Elements can be in two general modes: fast and slow. Each mode
1961 // corrensponds to a set of object representations of elements that 1965 // corrensponds to a set of object representations of elements that
1962 // have something in common. 1966 // have something in common.
1963 // 1967 //
1964 // In the fast mode elements is a FixedArray and so each element can 1968 // In the fast mode elements is a FixedArray and so each element can
1965 // be quickly accessed. This fact is used in the generated code. The 1969 // be quickly accessed. This fact is used in the generated code. The
1966 // elements array can have one of three maps in this mode: 1970 // elements array can have one of three maps in this mode:
1967 // fixed_array_map, sloppy_arguments_elements_map or 1971 // fixed_array_map, sloppy_arguments_elements_map or
(...skipping 5233 matching lines...) Expand 10 before | Expand all | Expand 10 after
7201 // [shared]: The information about the function that 7205 // [shared]: The information about the function that
7202 // can be shared by instances. 7206 // can be shared by instances.
7203 DECL_ACCESSORS(shared, SharedFunctionInfo) 7207 DECL_ACCESSORS(shared, SharedFunctionInfo)
7204 7208
7205 // [context]: The context for this function. 7209 // [context]: The context for this function.
7206 inline Context* context(); 7210 inline Context* context();
7207 inline void set_context(Object* context); 7211 inline void set_context(Object* context);
7208 inline JSObject* global_proxy(); 7212 inline JSObject* global_proxy();
7209 inline Context* native_context(); 7213 inline Context* native_context();
7210 7214
7215 static MaybeHandle<Context> GetFunctionRealm(Handle<JSFunction> function);
7216
7211 // [code]: The generated code object for this function. Executed 7217 // [code]: The generated code object for this function. Executed
7212 // when the function is invoked, e.g. foo() or new foo(). See 7218 // when the function is invoked, e.g. foo() or new foo(). See
7213 // [[Call]] and [[Construct]] description in ECMA-262, section 7219 // [[Call]] and [[Construct]] description in ECMA-262, section
7214 // 8.6.2, page 27. 7220 // 8.6.2, page 27.
7215 inline Code* code(); 7221 inline Code* code();
7216 inline void set_code(Code* code); 7222 inline void set_code(Code* code);
7217 inline void set_code_no_write_barrier(Code* code); 7223 inline void set_code_no_write_barrier(Code* code);
7218 inline void ReplaceCode(Code* code); 7224 inline void ReplaceCode(Code* code);
7219 7225
7220 // Tells whether this function inlines the given shared function info. 7226 // Tells whether this function inlines the given shared function info.
(...skipping 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after
9495 // The JSProxy describes EcmaScript Harmony proxies 9501 // The JSProxy describes EcmaScript Harmony proxies
9496 class JSProxy: public JSReceiver { 9502 class JSProxy: public JSReceiver {
9497 public: 9503 public:
9498 // [handler]: The handler property. 9504 // [handler]: The handler property.
9499 DECL_ACCESSORS(handler, Object) 9505 DECL_ACCESSORS(handler, Object)
9500 // [target]: The target property. 9506 // [target]: The target property.
9501 DECL_ACCESSORS(target, Object) 9507 DECL_ACCESSORS(target, Object)
9502 // [hash]: The hash code property (undefined if not initialized yet). 9508 // [hash]: The hash code property (undefined if not initialized yet).
9503 DECL_ACCESSORS(hash, Object) 9509 DECL_ACCESSORS(hash, Object)
9504 9510
9511 static MaybeHandle<Context> GetFunctionRealm(Handle<JSProxy> proxy);
9512
9505 inline bool has_handler(); 9513 inline bool has_handler();
9506 9514
9507 DECLARE_CAST(JSProxy) 9515 DECLARE_CAST(JSProxy)
9508 9516
9509 static bool IsRevoked(Handle<JSProxy> proxy); 9517 static bool IsRevoked(Handle<JSProxy> proxy);
9510 9518
9511 // ES6 9.5.1 9519 // ES6 9.5.1
9512 static MaybeHandle<Object> GetPrototype(Handle<JSProxy> receiver); 9520 static MaybeHandle<Object> GetPrototype(Handle<JSProxy> receiver);
9513 9521
9514 // ES6 9.5.3 9522 // ES6 9.5.3
(...skipping 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after
10726 } 10734 }
10727 return value; 10735 return value;
10728 } 10736 }
10729 }; 10737 };
10730 10738
10731 10739
10732 } // NOLINT, false-positive due to second-order macros. 10740 } // NOLINT, false-positive due to second-order macros.
10733 } // NOLINT, false-positive due to second-order macros. 10741 } // NOLINT, false-positive due to second-order macros.
10734 10742
10735 #endif // V8_OBJECTS_H_ 10743 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698