OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_OBJECTS_SCOPE_INFO_INL_H_ |
| 6 #define V8_OBJECTS_SCOPE_INFO_INL_H_ |
| 7 |
| 8 #include "src/objects/scope-info.h" |
| 9 |
| 10 namespace v8 { |
| 11 namespace internal { |
| 12 |
| 13 bool ScopeInfo::IsAsmModule() { return AsmModuleField::decode(Flags()); } |
| 14 |
| 15 bool ScopeInfo::IsAsmFunction() { return AsmFunctionField::decode(Flags()); } |
| 16 |
| 17 bool ScopeInfo::HasSimpleParameters() { |
| 18 return HasSimpleParametersField::decode(Flags()); |
| 19 } |
| 20 |
| 21 #define SCOPE_INFO_FIELD_ACCESSORS(name) \ |
| 22 void ScopeInfo::Set##name(int value) { set(k##name, Smi::FromInt(value)); } \ |
| 23 int ScopeInfo::name() { \ |
| 24 if (length() > 0) { \ |
| 25 return Smi::cast(get(k##name))->value(); \ |
| 26 } else { \ |
| 27 return 0; \ |
| 28 } \ |
| 29 } |
| 30 FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(SCOPE_INFO_FIELD_ACCESSORS) |
| 31 #undef SCOPE_INFO_FIELD_ACCESSORS |
| 32 |
| 33 } // namespace internal |
| 34 } // namespace v8 |
| 35 |
| 36 #endif // V8_OBJECTS_SCOPE_INFO_INL_H |
OLD | NEW |