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

Unified Diff: src/objects.h

Issue 816913003: Implement ES6 rest parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable optimization of functions with rest parameters in parser Created 5 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 61daada4b9ae57c13bb34bd15d84d6fab5ff5025..d7592ffd9eb3375ee7ca45c7de4cd7fb62566a92 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -4174,6 +4174,10 @@ class ScopeInfo : public FixedArray {
// Return if this is a nested function within an asm module scope.
bool IsAsmFunction() { return AsmFunctionField::decode(Flags()); }
+ bool IsSimpleParameterList() {
+ return IsSimpleParameterListField::decode(Flags());
+ }
+
// Return the function_name if present.
String* FunctionName();
@@ -4331,6 +4335,8 @@ class ScopeInfo : public FixedArray {
class FunctionVariableMode : public BitField<VariableMode, 9, 3> {};
class AsmModuleField : public BitField<bool, 12, 1> {};
class AsmFunctionField : public BitField<bool, 13, 1> {};
+ class IsSimpleParameterListField
+ : public BitField<bool, AsmFunctionField::kNext, 1> {};
// BitFields representing the encoded information for context locals in the
// ContextLocalInfoEntries part.
@@ -7019,6 +7025,8 @@ class SharedFunctionInfo: public HeapObject {
// Calculate the number of in-object properties.
int CalculateInObjectProperties();
+ inline bool is_simple_parameter_list();
+
// Dispatched behavior.
DECLARE_PRINTER(SharedFunctionInfo)
DECLARE_VERIFIER(SharedFunctionInfo)
@@ -7525,6 +7533,11 @@ class JSFunction: public JSObject {
// Returns if this function has been compiled to native code yet.
inline bool is_compiled();
+ // Returns `false` if formal parameters include rest parameters, optional
+ // parameters, or destructuring parameters.
+ // TODO(caitp): make this a flag set during parsing
+ inline bool is_simple_parameter_list();
+
// [next_function_link]: Links functions into various lists, e.g. the list
// of optimized functions hanging off the native_context. The CodeFlusher
// uses this link to chain together flushing candidates. Treated weakly

Powered by Google App Engine
This is Rietveld 408576698