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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 4453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4464 | 4464 |
4465 // Is this scope the scope of a named function expression? | 4465 // Is this scope the scope of a named function expression? |
4466 bool HasFunctionName(); | 4466 bool HasFunctionName(); |
4467 | 4467 |
4468 // Return if this has context allocated locals. | 4468 // Return if this has context allocated locals. |
4469 bool HasHeapAllocatedLocals(); | 4469 bool HasHeapAllocatedLocals(); |
4470 | 4470 |
4471 // Return if contexts are allocated for this scope. | 4471 // Return if contexts are allocated for this scope. |
4472 bool HasContext(); | 4472 bool HasContext(); |
4473 | 4473 |
| 4474 // Return if this is a function scope with "use asm". |
| 4475 bool IsAsmModule() { return AsmModuleField::decode(Flags()); } |
| 4476 |
| 4477 // Return if this is a nested function within an asm module scope. |
| 4478 bool IsAsmFunction() { return AsmFunctionField::decode(Flags()); } |
| 4479 |
4474 // Return the function_name if present. | 4480 // Return the function_name if present. |
4475 String* FunctionName(); | 4481 String* FunctionName(); |
4476 | 4482 |
4477 // Return the name of the given parameter. | 4483 // Return the name of the given parameter. |
4478 String* ParameterName(int var); | 4484 String* ParameterName(int var); |
4479 | 4485 |
4480 // Return the name of the given local. | 4486 // Return the name of the given local. |
4481 String* LocalName(int var); | 4487 String* LocalName(int var); |
4482 | 4488 |
4483 // Return the name of the given stack local. | 4489 // Return the name of the given stack local. |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4618 CONTEXT, | 4624 CONTEXT, |
4619 UNUSED | 4625 UNUSED |
4620 }; | 4626 }; |
4621 | 4627 |
4622 // Properties of scopes. | 4628 // Properties of scopes. |
4623 class ScopeTypeField: public BitField<ScopeType, 0, 3> {}; | 4629 class ScopeTypeField: public BitField<ScopeType, 0, 3> {}; |
4624 class CallsEvalField: public BitField<bool, 3, 1> {}; | 4630 class CallsEvalField: public BitField<bool, 3, 1> {}; |
4625 class StrictModeField: public BitField<StrictMode, 4, 1> {}; | 4631 class StrictModeField: public BitField<StrictMode, 4, 1> {}; |
4626 class FunctionVariableField: public BitField<FunctionVariableInfo, 5, 2> {}; | 4632 class FunctionVariableField: public BitField<FunctionVariableInfo, 5, 2> {}; |
4627 class FunctionVariableMode: public BitField<VariableMode, 7, 3> {}; | 4633 class FunctionVariableMode: public BitField<VariableMode, 7, 3> {}; |
| 4634 class AsmModuleField : public BitField<bool, 10, 1> {}; |
| 4635 class AsmFunctionField : public BitField<bool, 11, 1> {}; |
4628 | 4636 |
4629 // BitFields representing the encoded information for context locals in the | 4637 // BitFields representing the encoded information for context locals in the |
4630 // ContextLocalInfoEntries part. | 4638 // ContextLocalInfoEntries part. |
4631 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; | 4639 class ContextLocalMode: public BitField<VariableMode, 0, 3> {}; |
4632 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; | 4640 class ContextLocalInitFlag: public BitField<InitializationFlag, 3, 1> {}; |
4633 class ContextLocalMaybeAssignedFlag | 4641 class ContextLocalMaybeAssignedFlag |
4634 : public BitField<MaybeAssignedFlag, 4, 1> {}; | 4642 : public BitField<MaybeAssignedFlag, 4, 1> {}; |
4635 }; | 4643 }; |
4636 | 4644 |
4637 | 4645 |
(...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7120 | 7128 |
7121 // Indicates that this function is a generator. | 7129 // Indicates that this function is a generator. |
7122 DECL_BOOLEAN_ACCESSORS(is_generator) | 7130 DECL_BOOLEAN_ACCESSORS(is_generator) |
7123 | 7131 |
7124 // Indicates that this function is an arrow function. | 7132 // Indicates that this function is an arrow function. |
7125 DECL_BOOLEAN_ACCESSORS(is_arrow) | 7133 DECL_BOOLEAN_ACCESSORS(is_arrow) |
7126 | 7134 |
7127 // Indicates that this function is a concise method. | 7135 // Indicates that this function is a concise method. |
7128 DECL_BOOLEAN_ACCESSORS(is_concise_method) | 7136 DECL_BOOLEAN_ACCESSORS(is_concise_method) |
7129 | 7137 |
| 7138 // Indicates that this function is an asm function. |
| 7139 DECL_BOOLEAN_ACCESSORS(asm_function) |
| 7140 |
7130 inline FunctionKind kind(); | 7141 inline FunctionKind kind(); |
7131 inline void set_kind(FunctionKind kind); | 7142 inline void set_kind(FunctionKind kind); |
7132 | 7143 |
7133 // Indicates whether or not the code in the shared function support | 7144 // Indicates whether or not the code in the shared function support |
7134 // deoptimization. | 7145 // deoptimization. |
7135 inline bool has_deoptimization_support(); | 7146 inline bool has_deoptimization_support(); |
7136 | 7147 |
7137 // Enable deoptimization support through recompiled code. | 7148 // Enable deoptimization support through recompiled code. |
7138 void EnableDeoptimizationSupport(Code* recompiled); | 7149 void EnableDeoptimizationSupport(Code* recompiled); |
7139 | 7150 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7320 kInlineBuiltin, | 7331 kInlineBuiltin, |
7321 kBoundFunction, | 7332 kBoundFunction, |
7322 kIsAnonymous, | 7333 kIsAnonymous, |
7323 kNameShouldPrintAsAnonymous, | 7334 kNameShouldPrintAsAnonymous, |
7324 kIsFunction, | 7335 kIsFunction, |
7325 kDontCache, | 7336 kDontCache, |
7326 kDontFlush, | 7337 kDontFlush, |
7327 kIsArrow, | 7338 kIsArrow, |
7328 kIsGenerator, | 7339 kIsGenerator, |
7329 kIsConciseMethod, | 7340 kIsConciseMethod, |
| 7341 kIsAsmFunction, |
7330 kCompilerHintsCount // Pseudo entry | 7342 kCompilerHintsCount // Pseudo entry |
7331 }; | 7343 }; |
7332 | 7344 |
7333 class FunctionKindBits : public BitField<FunctionKind, kIsArrow, 3> {}; | 7345 class FunctionKindBits : public BitField<FunctionKind, kIsArrow, 3> {}; |
7334 | 7346 |
7335 class DeoptCountBits : public BitField<int, 0, 4> {}; | 7347 class DeoptCountBits : public BitField<int, 0, 4> {}; |
7336 class OptReenableTriesBits : public BitField<int, 4, 18> {}; | 7348 class OptReenableTriesBits : public BitField<int, 4, 18> {}; |
7337 class ICAgeBits : public BitField<int, 22, 8> {}; | 7349 class ICAgeBits : public BitField<int, 22, 8> {}; |
7338 | 7350 |
7339 class OptCountBits : public BitField<int, 0, 22> {}; | 7351 class OptCountBits : public BitField<int, 0, 22> {}; |
(...skipping 3783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11123 } else { | 11135 } else { |
11124 value &= ~(1 << bit_position); | 11136 value &= ~(1 << bit_position); |
11125 } | 11137 } |
11126 return value; | 11138 return value; |
11127 } | 11139 } |
11128 }; | 11140 }; |
11129 | 11141 |
11130 } } // namespace v8::internal | 11142 } } // namespace v8::internal |
11131 | 11143 |
11132 #endif // V8_OBJECTS_H_ | 11144 #endif // V8_OBJECTS_H_ |
OLD | NEW |