Chromium Code Reviews| 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 : public BitField<bool, 13, 1> {}; | |
|
arv (Not doing code reviews)
2015/02/12 21:48:43
14 or AsmFunctionField::kNext
caitp (gmail)
2015/02/12 22:12:03
Oops, fixed! I'm going with the kNext option, seem
| |
| 4334 | 4339 |
| 4335 // BitFields representing the encoded information for context locals in the | 4340 // BitFields representing the encoded information for context locals in the |
| 4336 // ContextLocalInfoEntries part. | 4341 // ContextLocalInfoEntries part. |
| 4337 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; | 4342 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; |
| 4338 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; | 4343 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; |
| 4339 class ContextLocalMaybeAssignedFlag | 4344 class ContextLocalMaybeAssignedFlag |
| 4340 : public BitField<MaybeAssignedFlag, 4, 1> {}; | 4345 : public BitField<MaybeAssignedFlag, 4, 1> {}; |
| 4341 }; | 4346 }; |
| 4342 | 4347 |
| 4343 | 4348 |
| (...skipping 2668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7012 | 7017 |
| 7013 // Source size of this function. | 7018 // Source size of this function. |
| 7014 int SourceSize(); | 7019 int SourceSize(); |
| 7015 | 7020 |
| 7016 // Calculate the instance size. | 7021 // Calculate the instance size. |
| 7017 int CalculateInstanceSize(); | 7022 int CalculateInstanceSize(); |
| 7018 | 7023 |
| 7019 // Calculate the number of in-object properties. | 7024 // Calculate the number of in-object properties. |
| 7020 int CalculateInObjectProperties(); | 7025 int CalculateInObjectProperties(); |
| 7021 | 7026 |
| 7027 inline bool is_simple_parameter_list(); | |
| 7028 | |
| 7022 // Dispatched behavior. | 7029 // Dispatched behavior. |
| 7023 DECLARE_PRINTER(SharedFunctionInfo) | 7030 DECLARE_PRINTER(SharedFunctionInfo) |
| 7024 DECLARE_VERIFIER(SharedFunctionInfo) | 7031 DECLARE_VERIFIER(SharedFunctionInfo) |
| 7025 | 7032 |
| 7026 void ResetForNewContext(int new_ic_age); | 7033 void ResetForNewContext(int new_ic_age); |
| 7027 | 7034 |
| 7028 DECLARE_CAST(SharedFunctionInfo) | 7035 DECLARE_CAST(SharedFunctionInfo) |
| 7029 | 7036 |
| 7030 // Constants. | 7037 // Constants. |
| 7031 static const int kDontAdaptArgumentsSentinel = -1; | 7038 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 | 7525 // 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. | 7526 // if it has one already, but simply replaces it with the new value. |
| 7520 // Instances created afterwards will have a map whose [[class]] is | 7527 // Instances created afterwards will have a map whose [[class]] is |
| 7521 // set to 'value', but there is no guarantees on instances created | 7528 // set to 'value', but there is no guarantees on instances created |
| 7522 // before. | 7529 // before. |
| 7523 void SetInstanceClassName(String* name); | 7530 void SetInstanceClassName(String* name); |
| 7524 | 7531 |
| 7525 // Returns if this function has been compiled to native code yet. | 7532 // Returns if this function has been compiled to native code yet. |
| 7526 inline bool is_compiled(); | 7533 inline bool is_compiled(); |
| 7527 | 7534 |
| 7535 // Returns `false` if formal parameters include rest parameters, optional | |
| 7536 // parameters, or destructuring parameters. | |
| 7537 // TODO(caitp): make this a flag set during parsing | |
| 7538 inline bool is_simple_parameter_list(); | |
| 7539 | |
| 7528 // [next_function_link]: Links functions into various lists, e.g. the list | 7540 // [next_function_link]: Links functions into various lists, e.g. the list |
| 7529 // of optimized functions hanging off the native_context. The CodeFlusher | 7541 // of optimized functions hanging off the native_context. The CodeFlusher |
| 7530 // uses this link to chain together flushing candidates. Treated weakly | 7542 // uses this link to chain together flushing candidates. Treated weakly |
| 7531 // by the garbage collector. | 7543 // by the garbage collector. |
| 7532 DECL_ACCESSORS(next_function_link, Object) | 7544 DECL_ACCESSORS(next_function_link, Object) |
| 7533 | 7545 |
| 7534 // Prints the name of the function using PrintF. | 7546 // Prints the name of the function using PrintF. |
| 7535 void PrintName(FILE* out = stdout); | 7547 void PrintName(FILE* out = stdout); |
| 7536 | 7548 |
| 7537 DECLARE_CAST(JSFunction) | 7549 DECLARE_CAST(JSFunction) |
| (...skipping 3417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10955 } else { | 10967 } else { |
| 10956 value &= ~(1 << bit_position); | 10968 value &= ~(1 << bit_position); |
| 10957 } | 10969 } |
| 10958 return value; | 10970 return value; |
| 10959 } | 10971 } |
| 10960 }; | 10972 }; |
| 10961 | 10973 |
| 10962 } } // namespace v8::internal | 10974 } } // namespace v8::internal |
| 10963 | 10975 |
| 10964 #endif // V8_OBJECTS_H_ | 10976 #endif // V8_OBJECTS_H_ |
| OLD | NEW |