OLD | NEW |
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 4156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4167 | 4167 |
4168 // Return if contexts are allocated for this scope. | 4168 // Return if contexts are allocated for this scope. |
4169 bool HasContext(); | 4169 bool HasContext(); |
4170 | 4170 |
4171 // Return if this is a function scope with "use asm". | 4171 // Return if this is a function scope with "use asm". |
4172 bool IsAsmModule() { return AsmModuleField::decode(Flags()); } | 4172 bool IsAsmModule() { return AsmModuleField::decode(Flags()); } |
4173 | 4173 |
4174 // Return if this is a nested function within an asm module scope. | 4174 // Return if this is a nested function within an asm module scope. |
4175 bool IsAsmFunction() { return AsmFunctionField::decode(Flags()); } | 4175 bool IsAsmFunction() { return AsmFunctionField::decode(Flags()); } |
4176 | 4176 |
| 4177 bool IsSimpleParameterList() { |
| 4178 return IsSimpleParameterListField::decode(Flags()); |
| 4179 } |
| 4180 |
4177 // Return the function_name if present. | 4181 // Return the function_name if present. |
4178 String* FunctionName(); | 4182 String* FunctionName(); |
4179 | 4183 |
4180 // Return the name of the given parameter. | 4184 // Return the name of the given parameter. |
4181 String* ParameterName(int var); | 4185 String* ParameterName(int var); |
4182 | 4186 |
4183 // Return the name of the given local. | 4187 // Return the name of the given local. |
4184 String* LocalName(int var); | 4188 String* LocalName(int var); |
4185 | 4189 |
4186 // Return the name of the given stack local. | 4190 // Return the name of the given stack local. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4324 | 4328 |
4325 // Properties of scopes. | 4329 // Properties of scopes. |
4326 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; | 4330 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; |
4327 class CallsEvalField : public BitField<bool, 4, 1> {}; | 4331 class CallsEvalField : public BitField<bool, 4, 1> {}; |
4328 STATIC_ASSERT(LANGUAGE_END == 3); | 4332 STATIC_ASSERT(LANGUAGE_END == 3); |
4329 class LanguageModeField : public BitField<LanguageMode, 5, 2> {}; | 4333 class LanguageModeField : public BitField<LanguageMode, 5, 2> {}; |
4330 class FunctionVariableField : public BitField<FunctionVariableInfo, 7, 2> {}; | 4334 class FunctionVariableField : public BitField<FunctionVariableInfo, 7, 2> {}; |
4331 class FunctionVariableMode : public BitField<VariableMode, 9, 3> {}; | 4335 class FunctionVariableMode : public BitField<VariableMode, 9, 3> {}; |
4332 class AsmModuleField : public BitField<bool, 12, 1> {}; | 4336 class AsmModuleField : public BitField<bool, 12, 1> {}; |
4333 class AsmFunctionField : public BitField<bool, 13, 1> {}; | 4337 class AsmFunctionField : public BitField<bool, 13, 1> {}; |
| 4338 class IsSimpleParameterListField |
| 4339 : public BitField<bool, AsmFunctionField::kNext, 1> {}; |
4334 | 4340 |
4335 // BitFields representing the encoded information for context locals in the | 4341 // BitFields representing the encoded information for context locals in the |
4336 // ContextLocalInfoEntries part. | 4342 // ContextLocalInfoEntries part. |
4337 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; | 4343 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; |
4338 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; | 4344 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; |
4339 class ContextLocalMaybeAssignedFlag | 4345 class ContextLocalMaybeAssignedFlag |
4340 : public BitField<MaybeAssignedFlag, 4, 1> {}; | 4346 : public BitField<MaybeAssignedFlag, 4, 1> {}; |
4341 }; | 4347 }; |
4342 | 4348 |
4343 | 4349 |
(...skipping 2668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7012 | 7018 |
7013 // Source size of this function. | 7019 // Source size of this function. |
7014 int SourceSize(); | 7020 int SourceSize(); |
7015 | 7021 |
7016 // Calculate the instance size. | 7022 // Calculate the instance size. |
7017 int CalculateInstanceSize(); | 7023 int CalculateInstanceSize(); |
7018 | 7024 |
7019 // Calculate the number of in-object properties. | 7025 // Calculate the number of in-object properties. |
7020 int CalculateInObjectProperties(); | 7026 int CalculateInObjectProperties(); |
7021 | 7027 |
| 7028 inline bool is_simple_parameter_list(); |
| 7029 |
7022 // Dispatched behavior. | 7030 // Dispatched behavior. |
7023 DECLARE_PRINTER(SharedFunctionInfo) | 7031 DECLARE_PRINTER(SharedFunctionInfo) |
7024 DECLARE_VERIFIER(SharedFunctionInfo) | 7032 DECLARE_VERIFIER(SharedFunctionInfo) |
7025 | 7033 |
7026 void ResetForNewContext(int new_ic_age); | 7034 void ResetForNewContext(int new_ic_age); |
7027 | 7035 |
7028 DECLARE_CAST(SharedFunctionInfo) | 7036 DECLARE_CAST(SharedFunctionInfo) |
7029 | 7037 |
7030 // Constants. | 7038 // Constants. |
7031 static const int kDontAdaptArgumentsSentinel = -1; | 7039 static const int kDontAdaptArgumentsSentinel = -1; |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7518 // not have one. Note that this method does not copy the initial map | 7526 // not have one. Note that this method does not copy the initial map |
7519 // if it has one already, but simply replaces it with the new value. | 7527 // if it has one already, but simply replaces it with the new value. |
7520 // Instances created afterwards will have a map whose [[class]] is | 7528 // Instances created afterwards will have a map whose [[class]] is |
7521 // set to 'value', but there is no guarantees on instances created | 7529 // set to 'value', but there is no guarantees on instances created |
7522 // before. | 7530 // before. |
7523 void SetInstanceClassName(String* name); | 7531 void SetInstanceClassName(String* name); |
7524 | 7532 |
7525 // Returns if this function has been compiled to native code yet. | 7533 // Returns if this function has been compiled to native code yet. |
7526 inline bool is_compiled(); | 7534 inline bool is_compiled(); |
7527 | 7535 |
| 7536 // Returns `false` if formal parameters include rest parameters, optional |
| 7537 // parameters, or destructuring parameters. |
| 7538 // TODO(caitp): make this a flag set during parsing |
| 7539 inline bool is_simple_parameter_list(); |
| 7540 |
7528 // [next_function_link]: Links functions into various lists, e.g. the list | 7541 // [next_function_link]: Links functions into various lists, e.g. the list |
7529 // of optimized functions hanging off the native_context. The CodeFlusher | 7542 // of optimized functions hanging off the native_context. The CodeFlusher |
7530 // uses this link to chain together flushing candidates. Treated weakly | 7543 // uses this link to chain together flushing candidates. Treated weakly |
7531 // by the garbage collector. | 7544 // by the garbage collector. |
7532 DECL_ACCESSORS(next_function_link, Object) | 7545 DECL_ACCESSORS(next_function_link, Object) |
7533 | 7546 |
7534 // Prints the name of the function using PrintF. | 7547 // Prints the name of the function using PrintF. |
7535 void PrintName(FILE* out = stdout); | 7548 void PrintName(FILE* out = stdout); |
7536 | 7549 |
7537 DECLARE_CAST(JSFunction) | 7550 DECLARE_CAST(JSFunction) |
(...skipping 3417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10955 } else { | 10968 } else { |
10956 value &= ~(1 << bit_position); | 10969 value &= ~(1 << bit_position); |
10957 } | 10970 } |
10958 return value; | 10971 return value; |
10959 } | 10972 } |
10960 }; | 10973 }; |
10961 | 10974 |
10962 } } // namespace v8::internal | 10975 } } // namespace v8::internal |
10963 | 10976 |
10964 #endif // V8_OBJECTS_H_ | 10977 #endif // V8_OBJECTS_H_ |
OLD | NEW |