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 4227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4238 // parameter index for a given parameter name if the parameter is present; | 4238 // parameter index for a given parameter name if the parameter is present; |
4239 // otherwise returns a value < 0. The name must be an internalized string. | 4239 // otherwise returns a value < 0. The name must be an internalized string. |
4240 int ParameterIndex(String* name); | 4240 int ParameterIndex(String* name); |
4241 | 4241 |
4242 // Lookup support for serialized scope info. Returns the function context | 4242 // Lookup support for serialized scope info. Returns the function context |
4243 // slot index if the function name is present and context-allocated (named | 4243 // slot index if the function name is present and context-allocated (named |
4244 // function expressions, only), otherwise returns a value < 0. The name | 4244 // function expressions, only), otherwise returns a value < 0. The name |
4245 // must be an internalized string. | 4245 // must be an internalized string. |
4246 int FunctionContextSlotIndex(String* name, VariableMode* mode); | 4246 int FunctionContextSlotIndex(String* name, VariableMode* mode); |
4247 | 4247 |
| 4248 bool block_scope_is_class_scope(); |
| 4249 FunctionKind function_kind(); |
4248 | 4250 |
4249 // Copies all the context locals into an object used to materialize a scope. | 4251 // Copies all the context locals into an object used to materialize a scope. |
4250 static bool CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info, | 4252 static bool CopyContextLocalsToScopeObject(Handle<ScopeInfo> scope_info, |
4251 Handle<Context> context, | 4253 Handle<Context> context, |
4252 Handle<JSObject> scope_object); | 4254 Handle<JSObject> scope_object); |
4253 | 4255 |
4254 | 4256 |
4255 static Handle<ScopeInfo> Create(Isolate* isolate, Zone* zone, Scope* scope); | 4257 static Handle<ScopeInfo> Create(Isolate* isolate, Zone* zone, Scope* scope); |
4256 | 4258 |
4257 // Serializes empty scope info. | 4259 // Serializes empty scope info. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4343 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; | 4345 class ScopeTypeField : public BitField<ScopeType, 0, 4> {}; |
4344 class CallsEvalField : public BitField<bool, 4, 1> {}; | 4346 class CallsEvalField : public BitField<bool, 4, 1> {}; |
4345 STATIC_ASSERT(LANGUAGE_END == 3); | 4347 STATIC_ASSERT(LANGUAGE_END == 3); |
4346 class LanguageModeField : public BitField<LanguageMode, 5, 2> {}; | 4348 class LanguageModeField : public BitField<LanguageMode, 5, 2> {}; |
4347 class FunctionVariableField : public BitField<FunctionVariableInfo, 7, 2> {}; | 4349 class FunctionVariableField : public BitField<FunctionVariableInfo, 7, 2> {}; |
4348 class FunctionVariableMode : public BitField<VariableMode, 9, 3> {}; | 4350 class FunctionVariableMode : public BitField<VariableMode, 9, 3> {}; |
4349 class AsmModuleField : public BitField<bool, 12, 1> {}; | 4351 class AsmModuleField : public BitField<bool, 12, 1> {}; |
4350 class AsmFunctionField : public BitField<bool, 13, 1> {}; | 4352 class AsmFunctionField : public BitField<bool, 13, 1> {}; |
4351 class IsSimpleParameterListField | 4353 class IsSimpleParameterListField |
4352 : public BitField<bool, AsmFunctionField::kNext, 1> {}; | 4354 : public BitField<bool, AsmFunctionField::kNext, 1> {}; |
| 4355 class BlockScopeIsClassScopeField |
| 4356 : public BitField<bool, IsSimpleParameterListField::kNext, 1> {}; |
| 4357 class FunctionKindField |
| 4358 : public BitField<FunctionKind, BlockScopeIsClassScopeField::kNext, 7> {}; |
4353 | 4359 |
4354 // BitFields representing the encoded information for context locals in the | 4360 // BitFields representing the encoded information for context locals in the |
4355 // ContextLocalInfoEntries part. | 4361 // ContextLocalInfoEntries part. |
4356 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; | 4362 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; |
4357 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; | 4363 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; |
4358 class ContextLocalMaybeAssignedFlag | 4364 class ContextLocalMaybeAssignedFlag |
4359 : public BitField<MaybeAssignedFlag, 4, 1> {}; | 4365 : public BitField<MaybeAssignedFlag, 4, 1> {}; |
4360 }; | 4366 }; |
4361 | 4367 |
4362 | 4368 |
(...skipping 6620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10983 } else { | 10989 } else { |
10984 value &= ~(1 << bit_position); | 10990 value &= ~(1 << bit_position); |
10985 } | 10991 } |
10986 return value; | 10992 return value; |
10987 } | 10993 } |
10988 }; | 10994 }; |
10989 | 10995 |
10990 } } // namespace v8::internal | 10996 } } // namespace v8::internal |
10991 | 10997 |
10992 #endif // V8_OBJECTS_H_ | 10998 #endif // V8_OBJECTS_H_ |
OLD | NEW |