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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "src/handles-inl.h" | 23 #include "src/handles-inl.h" |
24 #include "src/heap/heap-inl.h" | 24 #include "src/heap/heap-inl.h" |
25 #include "src/heap/heap.h" | 25 #include "src/heap/heap.h" |
26 #include "src/isolate-inl.h" | 26 #include "src/isolate-inl.h" |
27 #include "src/isolate.h" | 27 #include "src/isolate.h" |
28 #include "src/keys.h" | 28 #include "src/keys.h" |
29 #include "src/layout-descriptor-inl.h" | 29 #include "src/layout-descriptor-inl.h" |
30 #include "src/lookup-cache-inl.h" | 30 #include "src/lookup-cache-inl.h" |
31 #include "src/lookup.h" | 31 #include "src/lookup.h" |
32 #include "src/objects.h" | 32 #include "src/objects.h" |
| 33 #include "src/objects/scope-info.h" |
33 #include "src/property.h" | 34 #include "src/property.h" |
34 #include "src/prototype.h" | 35 #include "src/prototype.h" |
35 #include "src/transitions-inl.h" | 36 #include "src/transitions-inl.h" |
36 #include "src/type-feedback-vector-inl.h" | 37 #include "src/type-feedback-vector-inl.h" |
37 #include "src/v8memory.h" | 38 #include "src/v8memory.h" |
38 | 39 |
39 namespace v8 { | 40 namespace v8 { |
40 namespace internal { | 41 namespace internal { |
41 | 42 |
42 PropertyDetails::PropertyDetails(Smi* smi) { | 43 PropertyDetails::PropertyDetails(Smi* smi) { |
(...skipping 7983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8026 } | 8027 } |
8027 | 8028 |
8028 | 8029 |
8029 template <int entrysize> | 8030 template <int entrysize> |
8030 Handle<Object> WeakHashTableShape<entrysize>::AsHandle(Isolate* isolate, | 8031 Handle<Object> WeakHashTableShape<entrysize>::AsHandle(Isolate* isolate, |
8031 Handle<Object> key) { | 8032 Handle<Object> key) { |
8032 return key; | 8033 return key; |
8033 } | 8034 } |
8034 | 8035 |
8035 | 8036 |
8036 bool ScopeInfo::IsAsmModule() { return AsmModuleField::decode(Flags()); } | |
8037 | |
8038 | |
8039 bool ScopeInfo::IsAsmFunction() { return AsmFunctionField::decode(Flags()); } | |
8040 | |
8041 | |
8042 bool ScopeInfo::HasSimpleParameters() { | |
8043 return HasSimpleParametersField::decode(Flags()); | |
8044 } | |
8045 | |
8046 | |
8047 #define SCOPE_INFO_FIELD_ACCESSORS(name) \ | |
8048 void ScopeInfo::Set##name(int value) { set(k##name, Smi::FromInt(value)); } \ | |
8049 int ScopeInfo::name() { \ | |
8050 if (length() > 0) { \ | |
8051 return Smi::cast(get(k##name))->value(); \ | |
8052 } else { \ | |
8053 return 0; \ | |
8054 } \ | |
8055 } | |
8056 FOR_EACH_SCOPE_INFO_NUMERIC_FIELD(SCOPE_INFO_FIELD_ACCESSORS) | |
8057 #undef SCOPE_INFO_FIELD_ACCESSORS | |
8058 | |
8059 ACCESSORS(ModuleInfoEntry, export_name, Object, kExportNameOffset) | 8037 ACCESSORS(ModuleInfoEntry, export_name, Object, kExportNameOffset) |
8060 ACCESSORS(ModuleInfoEntry, local_name, Object, kLocalNameOffset) | 8038 ACCESSORS(ModuleInfoEntry, local_name, Object, kLocalNameOffset) |
8061 ACCESSORS(ModuleInfoEntry, import_name, Object, kImportNameOffset) | 8039 ACCESSORS(ModuleInfoEntry, import_name, Object, kImportNameOffset) |
8062 SMI_ACCESSORS(ModuleInfoEntry, module_request, kModuleRequestOffset) | 8040 SMI_ACCESSORS(ModuleInfoEntry, module_request, kModuleRequestOffset) |
8063 SMI_ACCESSORS(ModuleInfoEntry, cell_index, kCellIndexOffset) | 8041 SMI_ACCESSORS(ModuleInfoEntry, cell_index, kCellIndexOffset) |
8064 SMI_ACCESSORS(ModuleInfoEntry, beg_pos, kBegPosOffset) | 8042 SMI_ACCESSORS(ModuleInfoEntry, beg_pos, kBegPosOffset) |
8065 SMI_ACCESSORS(ModuleInfoEntry, end_pos, kEndPosOffset) | 8043 SMI_ACCESSORS(ModuleInfoEntry, end_pos, kEndPosOffset) |
8066 | 8044 |
8067 FixedArray* ModuleInfo::module_requests() const { | 8045 FixedArray* ModuleInfo::module_requests() const { |
8068 return FixedArray::cast(get(kModuleRequestsIndex)); | 8046 return FixedArray::cast(get(kModuleRequestsIndex)); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8431 #undef WRITE_INT64_FIELD | 8409 #undef WRITE_INT64_FIELD |
8432 #undef READ_BYTE_FIELD | 8410 #undef READ_BYTE_FIELD |
8433 #undef WRITE_BYTE_FIELD | 8411 #undef WRITE_BYTE_FIELD |
8434 #undef NOBARRIER_READ_BYTE_FIELD | 8412 #undef NOBARRIER_READ_BYTE_FIELD |
8435 #undef NOBARRIER_WRITE_BYTE_FIELD | 8413 #undef NOBARRIER_WRITE_BYTE_FIELD |
8436 | 8414 |
8437 } // namespace internal | 8415 } // namespace internal |
8438 } // namespace v8 | 8416 } // namespace v8 |
8439 | 8417 |
8440 #endif // V8_OBJECTS_INL_H_ | 8418 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |