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

Unified Diff: src/objects.h

Issue 1712833002: Don't reflect ES2015 Function name inference in Function.prototype.toString (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 fcd11a1960884cf656baec91ff52067c5a25f670..8ac996cdf7db5926e464f1e377d985ce13dd7140 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6774,8 +6774,8 @@ class SharedFunctionInfo: public HeapObject {
inline int end_position() const;
inline void set_end_position(int end_position);
- // Is this function a function expression in the source code.
- DECL_BOOLEAN_ACCESSORS(is_expression)
+ // Is this function a named function expression in the source code.
+ DECL_BOOLEAN_ACCESSORS(is_named_expression)
// Is this function a top-level function (scripts, evals).
DECL_BOOLEAN_ACCESSORS(is_toplevel)
@@ -6843,9 +6843,10 @@ class SharedFunctionInfo: public HeapObject {
// see a binding for it.
DECL_BOOLEAN_ACCESSORS(name_should_print_as_anonymous)
- // Indicates that the function is anonymous (the name field can be set
- // through the API, which does not change this flag).
- DECL_BOOLEAN_ACCESSORS(is_anonymous)
+ // Indicates that the function is either an anonymous expression
+ // or an arrow function (the name field can be set through the API,
+ // which does not change this flag).
+ DECL_BOOLEAN_ACCESSORS(is_anonymous_expression)
// Is this a function or top-level/eval code.
DECL_BOOLEAN_ACCESSORS(is_function)
@@ -6880,6 +6881,9 @@ class SharedFunctionInfo: public HeapObject {
// Indicates that the the shared function info has never been compiled before.
DECL_BOOLEAN_ACCESSORS(never_compiled)
+ // Whether this function was created from a FunctionDeclaration.
+ DECL_BOOLEAN_ACCESSORS(is_declaration)
+
inline FunctionKind kind();
inline void set_kind(FunctionKind kind);
@@ -7113,10 +7117,10 @@ class SharedFunctionInfo: public HeapObject {
// Bit positions in start_position_and_type.
// The source code start position is in the 30 most significant bits of
// the start_position_and_type field.
- static const int kIsExpressionBit = 0;
- static const int kIsTopLevelBit = 1;
+ static const int kIsNamedExpressionBit = 0;
+ static const int kIsTopLevelBit = 1;
static const int kStartPositionShift = 2;
- static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
+ static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
// Bit positions in compiler_hints.
enum CompilerHints {
@@ -7133,7 +7137,7 @@ class SharedFunctionInfo: public HeapObject {
kHasDuplicateParameters,
kForceInline,
kIsAsmFunction,
- kIsAnonymous,
+ kIsAnonymousExpression,
kNameShouldPrintAsAnonymous,
kIsFunction,
kDontCrankshaft,
@@ -7150,6 +7154,7 @@ class SharedFunctionInfo: public HeapObject {
// byte 3
kDeserialized,
kNeverCompiled,
+ kIsDeclaration,
kCompilerHintsCount, // Pseudo entry
};
// Add hints for other modes when they're added.

Powered by Google App Engine
This is Rietveld 408576698