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

Side by Side Diff: src/objects.h

Issue 1590273002: [runtime] No need to carry around the creation context for JSBoundFunctions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix debug. Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/factory.cc ('k') | 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 7226 matching lines...) Expand 10 before | Expand all | Expand 10 after
7237 DECL_ACCESSORS(bound_target_function, JSReceiver) 7237 DECL_ACCESSORS(bound_target_function, JSReceiver)
7238 7238
7239 // [bound_this]: The value that is always passed as the this value when 7239 // [bound_this]: The value that is always passed as the this value when
7240 // calling the wrapped function. 7240 // calling the wrapped function.
7241 DECL_ACCESSORS(bound_this, Object) 7241 DECL_ACCESSORS(bound_this, Object)
7242 7242
7243 // [bound_arguments]: A list of values whose elements are used as the first 7243 // [bound_arguments]: A list of values whose elements are used as the first
7244 // arguments to any call to the wrapped function. 7244 // arguments to any call to the wrapped function.
7245 DECL_ACCESSORS(bound_arguments, FixedArray) 7245 DECL_ACCESSORS(bound_arguments, FixedArray)
7246 7246
7247 // [creation_context]: The native context in which the function was bound.
7248 // TODO(bmeurer, verwaest): Can we (mis)use (unused) constructor field in
7249 // the Map instead of putting this into the object? Only required for
7250 // JSReceiver::GetCreationContext() anyway.
7251 DECL_ACCESSORS(creation_context, Context)
7252
7253 static MaybeHandle<Context> GetFunctionRealm( 7247 static MaybeHandle<Context> GetFunctionRealm(
7254 Handle<JSBoundFunction> function); 7248 Handle<JSBoundFunction> function);
7255 7249
7256 DECLARE_CAST(JSBoundFunction) 7250 DECLARE_CAST(JSBoundFunction)
7257 7251
7258 // Dispatched behavior. 7252 // Dispatched behavior.
7259 DECLARE_PRINTER(JSBoundFunction) 7253 DECLARE_PRINTER(JSBoundFunction)
7260 DECLARE_VERIFIER(JSBoundFunction) 7254 DECLARE_VERIFIER(JSBoundFunction)
7261 7255
7262 // The bound function's string representation implemented according 7256 // The bound function's string representation implemented according
7263 // to ES6 section 19.2.3.5 Function.prototype.toString ( ). 7257 // to ES6 section 19.2.3.5 Function.prototype.toString ( ).
7264 static Handle<String> ToString(Handle<JSBoundFunction> function); 7258 static Handle<String> ToString(Handle<JSBoundFunction> function);
7265 7259
7266 // Layout description. 7260 // Layout description.
7267 static const int kBoundTargetFunctionOffset = JSObject::kHeaderSize; 7261 static const int kBoundTargetFunctionOffset = JSObject::kHeaderSize;
7268 static const int kBoundThisOffset = kBoundTargetFunctionOffset + kPointerSize; 7262 static const int kBoundThisOffset = kBoundTargetFunctionOffset + kPointerSize;
7269 static const int kBoundArgumentsOffset = kBoundThisOffset + kPointerSize; 7263 static const int kBoundArgumentsOffset = kBoundThisOffset + kPointerSize;
7270 static const int kCreationContextOffset = 7264 static const int kLengthOffset = kBoundArgumentsOffset + kPointerSize;
7271 kBoundArgumentsOffset + kPointerSize;
7272 static const int kLengthOffset = kCreationContextOffset + kPointerSize;
7273 static const int kNameOffset = kLengthOffset + kPointerSize; 7265 static const int kNameOffset = kLengthOffset + kPointerSize;
7274 static const int kSize = kNameOffset + kPointerSize; 7266 static const int kSize = kNameOffset + kPointerSize;
7275 7267
7276 // Indices of in-object properties. 7268 // Indices of in-object properties.
7277 static const int kLengthIndex = 0; 7269 static const int kLengthIndex = 0;
7278 static const int kNameIndex = 1; 7270 static const int kNameIndex = 1;
7279 7271
7280 private: 7272 private:
7281 DISALLOW_IMPLICIT_CONSTRUCTORS(JSBoundFunction); 7273 DISALLOW_IMPLICIT_CONSTRUCTORS(JSBoundFunction);
7282 }; 7274 };
(...skipping 3467 matching lines...) Expand 10 before | Expand all | Expand 10 after
10750 } 10742 }
10751 return value; 10743 return value;
10752 } 10744 }
10753 }; 10745 };
10754 10746
10755 10747
10756 } // NOLINT, false-positive due to second-order macros. 10748 } // NOLINT, false-positive due to second-order macros.
10757 } // NOLINT, false-positive due to second-order macros. 10749 } // NOLINT, false-positive due to second-order macros.
10758 10750
10759 #endif // V8_OBJECTS_H_ 10751 #endif // V8_OBJECTS_H_
OLDNEW
« 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