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

Unified Diff: src/objects.h

Issue 1871503002: Lazily compute boundfunction .name and .length if possible (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed Created 4 years, 8 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/factory.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 2d0f9ea868e1cdba219dd606a2bb093344b09a20..cccbbe2896b1f6de3aa77e491735b77c200c439c 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -7382,12 +7382,6 @@ class JSModule: public JSObject {
// JSBoundFunction describes a bound function exotic object.
class JSBoundFunction : public JSObject {
public:
- // [length]: The bound function "length" property.
- DECL_ACCESSORS(length, Object)
-
- // [name]: The bound function "name" property.
- DECL_ACCESSORS(name, Object)
-
// [bound_target_function]: The wrapped function object.
DECL_ACCESSORS(bound_target_function, JSReceiver)
@@ -7399,6 +7393,8 @@ class JSBoundFunction : public JSObject {
// arguments to any call to the wrapped function.
DECL_ACCESSORS(bound_arguments, FixedArray)
+ static MaybeHandle<String> GetName(Isolate* isolate,
+ Handle<JSBoundFunction> function);
static MaybeHandle<Context> GetFunctionRealm(
Handle<JSBoundFunction> function);
@@ -7416,13 +7412,7 @@ class JSBoundFunction : public JSObject {
static const int kBoundTargetFunctionOffset = JSObject::kHeaderSize;
static const int kBoundThisOffset = kBoundTargetFunctionOffset + kPointerSize;
static const int kBoundArgumentsOffset = kBoundThisOffset + kPointerSize;
- static const int kLengthOffset = kBoundArgumentsOffset + kPointerSize;
- static const int kNameOffset = kLengthOffset + kPointerSize;
- static const int kSize = kNameOffset + kPointerSize;
-
- // Indices of in-object properties.
- static const int kLengthIndex = 0;
- static const int kNameIndex = 1;
+ static const int kSize = kBoundArgumentsOffset + kPointerSize;
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(JSBoundFunction);
@@ -7445,6 +7435,9 @@ class JSFunction: public JSObject {
inline JSObject* global_proxy();
inline Context* native_context();
+ static Handle<Object> GetName(Isolate* isolate, Handle<JSFunction> function);
+ static MaybeHandle<Smi> GetLength(Isolate* isolate,
+ Handle<JSFunction> function);
static Handle<Context> GetFunctionRealm(Handle<JSFunction> function);
// [code]: The generated code object for this function. Executed
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698