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 3866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3877 | 3877 |
3878 // Return if contexts are allocated for this scope. | 3878 // Return if contexts are allocated for this scope. |
3879 bool HasContext(); | 3879 bool HasContext(); |
3880 | 3880 |
3881 // Return if this is a function scope with "use asm". | 3881 // Return if this is a function scope with "use asm". |
3882 bool IsAsmModule() { return AsmModuleField::decode(Flags()); } | 3882 bool IsAsmModule() { return AsmModuleField::decode(Flags()); } |
3883 | 3883 |
3884 // Return if this is a nested function within an asm module scope. | 3884 // Return if this is a nested function within an asm module scope. |
3885 bool IsAsmFunction() { return AsmFunctionField::decode(Flags()); } | 3885 bool IsAsmFunction() { return AsmFunctionField::decode(Flags()); } |
3886 | 3886 |
3887 bool IsSimpleParameterList() { | 3887 bool HasSimpleParameters() { |
3888 return IsSimpleParameterListField::decode(Flags()); | 3888 return HasSimpleParametersField::decode(Flags()); |
3889 } | 3889 } |
3890 | 3890 |
3891 // Return the function_name if present. | 3891 // Return the function_name if present. |
3892 String* FunctionName(); | 3892 String* FunctionName(); |
3893 | 3893 |
3894 // Return the name of the given parameter. | 3894 // Return the name of the given parameter. |
3895 String* ParameterName(int var); | 3895 String* ParameterName(int var); |
3896 | 3896 |
3897 // Return the name of the given local. | 3897 // Return the name of the given local. |
3898 String* LocalName(int var); | 3898 String* LocalName(int var); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4077 class ReceiverVariableField | 4077 class ReceiverVariableField |
4078 : public BitField<VariableAllocationInfo, LanguageModeField::kNext, 2> {}; | 4078 : public BitField<VariableAllocationInfo, LanguageModeField::kNext, 2> {}; |
4079 class FunctionVariableField | 4079 class FunctionVariableField |
4080 : public BitField<VariableAllocationInfo, ReceiverVariableField::kNext, | 4080 : public BitField<VariableAllocationInfo, ReceiverVariableField::kNext, |
4081 2> {}; | 4081 2> {}; |
4082 class FunctionVariableMode | 4082 class FunctionVariableMode |
4083 : public BitField<VariableMode, FunctionVariableField::kNext, 3> {}; | 4083 : public BitField<VariableMode, FunctionVariableField::kNext, 3> {}; |
4084 class AsmModuleField : public BitField<bool, FunctionVariableMode::kNext, 1> { | 4084 class AsmModuleField : public BitField<bool, FunctionVariableMode::kNext, 1> { |
4085 }; | 4085 }; |
4086 class AsmFunctionField : public BitField<bool, AsmModuleField::kNext, 1> {}; | 4086 class AsmFunctionField : public BitField<bool, AsmModuleField::kNext, 1> {}; |
4087 class IsSimpleParameterListField | 4087 class HasSimpleParametersField |
4088 : public BitField<bool, AsmFunctionField::kNext, 1> {}; | 4088 : public BitField<bool, AsmFunctionField::kNext, 1> {}; |
4089 class FunctionKindField | 4089 class FunctionKindField |
4090 : public BitField<FunctionKind, IsSimpleParameterListField::kNext, 8> {}; | 4090 : public BitField<FunctionKind, HasSimpleParametersField::kNext, 8> {}; |
4091 | 4091 |
4092 // BitFields representing the encoded information for context locals in the | 4092 // BitFields representing the encoded information for context locals in the |
4093 // ContextLocalInfoEntries part. | 4093 // ContextLocalInfoEntries part. |
4094 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; | 4094 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; |
4095 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; | 4095 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; |
4096 class ContextLocalMaybeAssignedFlag | 4096 class ContextLocalMaybeAssignedFlag |
4097 : public BitField<MaybeAssignedFlag, 4, 1> {}; | 4097 : public BitField<MaybeAssignedFlag, 4, 1> {}; |
4098 | 4098 |
4099 friend class ScopeIterator; | 4099 friend class ScopeIterator; |
4100 }; | 4100 }; |
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6621 | 6621 |
6622 // Source size of this function. | 6622 // Source size of this function. |
6623 int SourceSize(); | 6623 int SourceSize(); |
6624 | 6624 |
6625 // Calculate the instance size. | 6625 // Calculate the instance size. |
6626 int CalculateInstanceSize(); | 6626 int CalculateInstanceSize(); |
6627 | 6627 |
6628 // Calculate the number of in-object properties. | 6628 // Calculate the number of in-object properties. |
6629 int CalculateInObjectProperties(); | 6629 int CalculateInObjectProperties(); |
6630 | 6630 |
6631 inline bool is_simple_parameter_list(); | 6631 inline bool has_simple_parameters(); |
6632 | 6632 |
6633 // Initialize a SharedFunctionInfo from a parsed function literal. | 6633 // Initialize a SharedFunctionInfo from a parsed function literal. |
6634 static void InitFromFunctionLiteral(Handle<SharedFunctionInfo> shared_info, | 6634 static void InitFromFunctionLiteral(Handle<SharedFunctionInfo> shared_info, |
6635 FunctionLiteral* lit); | 6635 FunctionLiteral* lit); |
6636 | 6636 |
6637 // Dispatched behavior. | 6637 // Dispatched behavior. |
6638 DECLARE_PRINTER(SharedFunctionInfo) | 6638 DECLARE_PRINTER(SharedFunctionInfo) |
6639 DECLARE_VERIFIER(SharedFunctionInfo) | 6639 DECLARE_VERIFIER(SharedFunctionInfo) |
6640 | 6640 |
6641 void ResetForNewContext(int new_ic_age); | 6641 void ResetForNewContext(int new_ic_age); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7136 // set to 'value', but there is no guarantees on instances created | 7136 // set to 'value', but there is no guarantees on instances created |
7137 // before. | 7137 // before. |
7138 void SetInstanceClassName(String* name); | 7138 void SetInstanceClassName(String* name); |
7139 | 7139 |
7140 // Returns if this function has been compiled to native code yet. | 7140 // Returns if this function has been compiled to native code yet. |
7141 inline bool is_compiled(); | 7141 inline bool is_compiled(); |
7142 | 7142 |
7143 // Returns `false` if formal parameters include rest parameters, optional | 7143 // Returns `false` if formal parameters include rest parameters, optional |
7144 // parameters, or destructuring parameters. | 7144 // parameters, or destructuring parameters. |
7145 // TODO(caitp): make this a flag set during parsing | 7145 // TODO(caitp): make this a flag set during parsing |
7146 inline bool is_simple_parameter_list(); | 7146 inline bool has_simple_parameters(); |
7147 | 7147 |
7148 // [next_function_link]: Links functions into various lists, e.g. the list | 7148 // [next_function_link]: Links functions into various lists, e.g. the list |
7149 // of optimized functions hanging off the native_context. The CodeFlusher | 7149 // of optimized functions hanging off the native_context. The CodeFlusher |
7150 // uses this link to chain together flushing candidates. Treated weakly | 7150 // uses this link to chain together flushing candidates. Treated weakly |
7151 // by the garbage collector. | 7151 // by the garbage collector. |
7152 DECL_ACCESSORS(next_function_link, Object) | 7152 DECL_ACCESSORS(next_function_link, Object) |
7153 | 7153 |
7154 // Prints the name of the function using PrintF. | 7154 // Prints the name of the function using PrintF. |
7155 void PrintName(FILE* out = stdout); | 7155 void PrintName(FILE* out = stdout); |
7156 | 7156 |
(...skipping 3386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10543 } else { | 10543 } else { |
10544 value &= ~(1 << bit_position); | 10544 value &= ~(1 << bit_position); |
10545 } | 10545 } |
10546 return value; | 10546 return value; |
10547 } | 10547 } |
10548 }; | 10548 }; |
10549 | 10549 |
10550 } } // namespace v8::internal | 10550 } } // namespace v8::internal |
10551 | 10551 |
10552 #endif // V8_OBJECTS_H_ | 10552 #endif // V8_OBJECTS_H_ |
OLD | NEW |