| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return map()->instance_type() == instancetype; \ | 140 return map()->instance_type() == instancetype; \ |
| 141 } | 141 } |
| 142 | 142 |
| 143 TYPE_CHECKER(BreakPointInfo, TUPLE2_TYPE) | 143 TYPE_CHECKER(BreakPointInfo, TUPLE2_TYPE) |
| 144 TYPE_CHECKER(ByteArray, BYTE_ARRAY_TYPE) | 144 TYPE_CHECKER(ByteArray, BYTE_ARRAY_TYPE) |
| 145 TYPE_CHECKER(BytecodeArray, BYTECODE_ARRAY_TYPE) | 145 TYPE_CHECKER(BytecodeArray, BYTECODE_ARRAY_TYPE) |
| 146 TYPE_CHECKER(CallHandlerInfo, TUPLE2_TYPE) | 146 TYPE_CHECKER(CallHandlerInfo, TUPLE2_TYPE) |
| 147 TYPE_CHECKER(Cell, CELL_TYPE) | 147 TYPE_CHECKER(Cell, CELL_TYPE) |
| 148 TYPE_CHECKER(Code, CODE_TYPE) | 148 TYPE_CHECKER(Code, CODE_TYPE) |
| 149 TYPE_CHECKER(ConstantElementsPair, TUPLE2_TYPE) | 149 TYPE_CHECKER(ConstantElementsPair, TUPLE2_TYPE) |
| 150 TYPE_CHECKER(CoverageInfo, FIXED_ARRAY_TYPE) |
| 150 TYPE_CHECKER(FixedDoubleArray, FIXED_DOUBLE_ARRAY_TYPE) | 151 TYPE_CHECKER(FixedDoubleArray, FIXED_DOUBLE_ARRAY_TYPE) |
| 151 TYPE_CHECKER(Foreign, FOREIGN_TYPE) | 152 TYPE_CHECKER(Foreign, FOREIGN_TYPE) |
| 152 TYPE_CHECKER(FreeSpace, FREE_SPACE_TYPE) | 153 TYPE_CHECKER(FreeSpace, FREE_SPACE_TYPE) |
| 153 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) | 154 TYPE_CHECKER(HeapNumber, HEAP_NUMBER_TYPE) |
| 154 TYPE_CHECKER(JSArgumentsObject, JS_ARGUMENTS_TYPE) | 155 TYPE_CHECKER(JSArgumentsObject, JS_ARGUMENTS_TYPE) |
| 155 TYPE_CHECKER(JSArray, JS_ARRAY_TYPE) | 156 TYPE_CHECKER(JSArray, JS_ARRAY_TYPE) |
| 156 TYPE_CHECKER(JSArrayBuffer, JS_ARRAY_BUFFER_TYPE) | 157 TYPE_CHECKER(JSArrayBuffer, JS_ARRAY_BUFFER_TYPE) |
| 157 TYPE_CHECKER(JSAsyncGeneratorObject, JS_ASYNC_GENERATOR_OBJECT_TYPE) | 158 TYPE_CHECKER(JSAsyncGeneratorObject, JS_ASYNC_GENERATOR_OBJECT_TYPE) |
| 158 TYPE_CHECKER(JSBoundFunction, JS_BOUND_FUNCTION_TYPE) | 159 TYPE_CHECKER(JSBoundFunction, JS_BOUND_FUNCTION_TYPE) |
| 159 TYPE_CHECKER(JSContextExtensionObject, JS_CONTEXT_EXTENSION_OBJECT_TYPE) | 160 TYPE_CHECKER(JSContextExtensionObject, JS_CONTEXT_EXTENSION_OBJECT_TYPE) |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 CAST_ACCESSOR(ArrayList) | 624 CAST_ACCESSOR(ArrayList) |
| 624 CAST_ACCESSOR(BoilerplateDescription) | 625 CAST_ACCESSOR(BoilerplateDescription) |
| 625 CAST_ACCESSOR(BreakPointInfo) | 626 CAST_ACCESSOR(BreakPointInfo) |
| 626 CAST_ACCESSOR(ByteArray) | 627 CAST_ACCESSOR(ByteArray) |
| 627 CAST_ACCESSOR(BytecodeArray) | 628 CAST_ACCESSOR(BytecodeArray) |
| 628 CAST_ACCESSOR(CallHandlerInfo) | 629 CAST_ACCESSOR(CallHandlerInfo) |
| 629 CAST_ACCESSOR(Cell) | 630 CAST_ACCESSOR(Cell) |
| 630 CAST_ACCESSOR(Code) | 631 CAST_ACCESSOR(Code) |
| 631 CAST_ACCESSOR(ConsString) | 632 CAST_ACCESSOR(ConsString) |
| 632 CAST_ACCESSOR(ConstantElementsPair) | 633 CAST_ACCESSOR(ConstantElementsPair) |
| 634 CAST_ACCESSOR(CoverageInfo) |
| 633 CAST_ACCESSOR(DeoptimizationInputData) | 635 CAST_ACCESSOR(DeoptimizationInputData) |
| 634 CAST_ACCESSOR(DeoptimizationOutputData) | 636 CAST_ACCESSOR(DeoptimizationOutputData) |
| 635 CAST_ACCESSOR(DependentCode) | 637 CAST_ACCESSOR(DependentCode) |
| 636 CAST_ACCESSOR(DescriptorArray) | 638 CAST_ACCESSOR(DescriptorArray) |
| 637 CAST_ACCESSOR(ExternalOneByteString) | 639 CAST_ACCESSOR(ExternalOneByteString) |
| 638 CAST_ACCESSOR(ExternalString) | 640 CAST_ACCESSOR(ExternalString) |
| 639 CAST_ACCESSOR(ExternalTwoByteString) | 641 CAST_ACCESSOR(ExternalTwoByteString) |
| 640 CAST_ACCESSOR(FixedArray) | 642 CAST_ACCESSOR(FixedArray) |
| 641 CAST_ACCESSOR(FixedArrayBase) | 643 CAST_ACCESSOR(FixedArrayBase) |
| 642 CAST_ACCESSOR(FixedDoubleArray) | 644 CAST_ACCESSOR(FixedDoubleArray) |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 | 1429 |
| 1428 #define NOBARRIER_WRITE_BYTE_FIELD(p, offset, value) \ | 1430 #define NOBARRIER_WRITE_BYTE_FIELD(p, offset, value) \ |
| 1429 base::NoBarrier_Store( \ | 1431 base::NoBarrier_Store( \ |
| 1430 reinterpret_cast<base::Atomic8*>(FIELD_ADDR(p, offset)), \ | 1432 reinterpret_cast<base::Atomic8*>(FIELD_ADDR(p, offset)), \ |
| 1431 static_cast<base::Atomic8>(value)); | 1433 static_cast<base::Atomic8>(value)); |
| 1432 | 1434 |
| 1433 Object** HeapObject::RawField(HeapObject* obj, int byte_offset) { | 1435 Object** HeapObject::RawField(HeapObject* obj, int byte_offset) { |
| 1434 return reinterpret_cast<Object**>(FIELD_ADDR(obj, byte_offset)); | 1436 return reinterpret_cast<Object**>(FIELD_ADDR(obj, byte_offset)); |
| 1435 } | 1437 } |
| 1436 | 1438 |
| 1439 int Smi::ToInt(Object* o) { return Smi::cast(o)->value(); } |
| 1437 | 1440 |
| 1438 MapWord MapWord::FromMap(const Map* map) { | 1441 MapWord MapWord::FromMap(const Map* map) { |
| 1439 return MapWord(reinterpret_cast<uintptr_t>(map)); | 1442 return MapWord(reinterpret_cast<uintptr_t>(map)); |
| 1440 } | 1443 } |
| 1441 | 1444 |
| 1442 | 1445 |
| 1443 Map* MapWord::ToMap() { | 1446 Map* MapWord::ToMap() { |
| 1444 return reinterpret_cast<Map*>(value_); | 1447 return reinterpret_cast<Map*>(value_); |
| 1445 } | 1448 } |
| 1446 | 1449 |
| (...skipping 4475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5922 kFeedbackMetadataOffset) | 5925 kFeedbackMetadataOffset) |
| 5923 SMI_ACCESSORS(SharedFunctionInfo, function_literal_id, kFunctionLiteralIdOffset) | 5926 SMI_ACCESSORS(SharedFunctionInfo, function_literal_id, kFunctionLiteralIdOffset) |
| 5924 #if TRACE_MAPS | 5927 #if TRACE_MAPS |
| 5925 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) | 5928 SMI_ACCESSORS(SharedFunctionInfo, unique_id, kUniqueIdOffset) |
| 5926 #endif | 5929 #endif |
| 5927 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, | 5930 ACCESSORS(SharedFunctionInfo, instance_class_name, Object, |
| 5928 kInstanceClassNameOffset) | 5931 kInstanceClassNameOffset) |
| 5929 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) | 5932 ACCESSORS(SharedFunctionInfo, function_data, Object, kFunctionDataOffset) |
| 5930 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) | 5933 ACCESSORS(SharedFunctionInfo, script, Object, kScriptOffset) |
| 5931 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) | 5934 ACCESSORS(SharedFunctionInfo, debug_info, Object, kDebugInfoOffset) |
| 5935 ACCESSORS(SharedFunctionInfo, coverage_info, Object, kCoverageInfoOffset) |
| 5932 ACCESSORS(SharedFunctionInfo, function_identifier, Object, | 5936 ACCESSORS(SharedFunctionInfo, function_identifier, Object, |
| 5933 kFunctionIdentifierOffset) | 5937 kFunctionIdentifierOffset) |
| 5934 | 5938 |
| 5935 SMI_ACCESSORS(FunctionTemplateInfo, length, kLengthOffset) | 5939 SMI_ACCESSORS(FunctionTemplateInfo, length, kLengthOffset) |
| 5936 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, | 5940 BOOL_ACCESSORS(FunctionTemplateInfo, flag, hidden_prototype, |
| 5937 kHiddenPrototypeBit) | 5941 kHiddenPrototypeBit) |
| 5938 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) | 5942 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) |
| 5939 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, | 5943 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, |
| 5940 kNeedsAccessCheckBit) | 5944 kNeedsAccessCheckBit) |
| 5941 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, | 5945 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6238 DebugInfo* SharedFunctionInfo::GetDebugInfo() const { | 6242 DebugInfo* SharedFunctionInfo::GetDebugInfo() const { |
| 6239 DCHECK(HasDebugInfo()); | 6243 DCHECK(HasDebugInfo()); |
| 6240 return DebugInfo::cast(debug_info()); | 6244 return DebugInfo::cast(debug_info()); |
| 6241 } | 6245 } |
| 6242 | 6246 |
| 6243 bool SharedFunctionInfo::HasDebugCode() const { | 6247 bool SharedFunctionInfo::HasDebugCode() const { |
| 6244 if (HasBaselineCode()) return code()->has_debug_break_slots(); | 6248 if (HasBaselineCode()) return code()->has_debug_break_slots(); |
| 6245 return HasBytecodeArray(); | 6249 return HasBytecodeArray(); |
| 6246 } | 6250 } |
| 6247 | 6251 |
| 6252 bool SharedFunctionInfo::HasCoverageInfo() const { |
| 6253 if (coverage_info()->IsSmi()) return false; |
| 6254 DCHECK(coverage_info()->IsCoverageInfo()); |
| 6255 return true; |
| 6256 } |
| 6257 |
| 6248 int SharedFunctionInfo::debugger_hints() const { | 6258 int SharedFunctionInfo::debugger_hints() const { |
| 6249 if (HasDebugInfo()) return GetDebugInfo()->debugger_hints(); | 6259 if (HasDebugInfo()) return GetDebugInfo()->debugger_hints(); |
| 6250 return Smi::cast(debug_info())->value(); | 6260 return Smi::cast(debug_info())->value(); |
| 6251 } | 6261 } |
| 6252 | 6262 |
| 6253 void SharedFunctionInfo::set_debugger_hints(int value) { | 6263 void SharedFunctionInfo::set_debugger_hints(int value) { |
| 6254 if (HasDebugInfo()) { | 6264 if (HasDebugInfo()) { |
| 6255 GetDebugInfo()->set_debugger_hints(value); | 6265 GetDebugInfo()->set_debugger_hints(value); |
| 6256 } else { | 6266 } else { |
| 6257 set_debug_info(Smi::FromInt(value)); | 6267 set_debug_info(Smi::FromInt(value)); |
| (...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8261 #undef WRITE_BYTE_FIELD | 8271 #undef WRITE_BYTE_FIELD |
| 8262 #undef NOBARRIER_READ_BYTE_FIELD | 8272 #undef NOBARRIER_READ_BYTE_FIELD |
| 8263 #undef NOBARRIER_WRITE_BYTE_FIELD | 8273 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 8264 | 8274 |
| 8265 } // namespace internal | 8275 } // namespace internal |
| 8266 } // namespace v8 | 8276 } // namespace v8 |
| 8267 | 8277 |
| 8268 #include "src/objects/object-macros-undef.h" | 8278 #include "src/objects/object-macros-undef.h" |
| 8269 | 8279 |
| 8270 #endif // V8_OBJECTS_INL_H_ | 8280 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |