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 6025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6036 kRemovePrototypeBit) | 6036 kRemovePrototypeBit) |
6037 BOOL_ACCESSORS(FunctionTemplateInfo, flag, do_not_cache, | 6037 BOOL_ACCESSORS(FunctionTemplateInfo, flag, do_not_cache, |
6038 kDoNotCacheBit) | 6038 kDoNotCacheBit) |
6039 BOOL_ACCESSORS(FunctionTemplateInfo, flag, accept_any_receiver, | 6039 BOOL_ACCESSORS(FunctionTemplateInfo, flag, accept_any_receiver, |
6040 kAcceptAnyReceiver) | 6040 kAcceptAnyReceiver) |
6041 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_named_expression, | 6041 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_named_expression, |
6042 kIsNamedExpressionBit) | 6042 kIsNamedExpressionBit) |
6043 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, | 6043 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, |
6044 kIsTopLevelBit) | 6044 kIsTopLevelBit) |
6045 | 6045 |
| 6046 BOOL_ACCESSORS(SharedFunctionInfo, end_position_and_is_blackboxed, |
| 6047 debug_is_blackboxed, kIsBlackboxedBit) |
| 6048 BOOL_ACCESSORS(SharedFunctionInfo, end_position_and_is_blackboxed, |
| 6049 computed_debug_is_blackboxed, kIsBlackboxedComputedBit) |
| 6050 |
6046 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, allows_lazy_compilation, | 6051 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, allows_lazy_compilation, |
6047 kAllowLazyCompilation) | 6052 kAllowLazyCompilation) |
6048 BOOL_ACCESSORS(SharedFunctionInfo, | 6053 BOOL_ACCESSORS(SharedFunctionInfo, |
6049 compiler_hints, | 6054 compiler_hints, |
6050 uses_arguments, | 6055 uses_arguments, |
6051 kUsesArguments) | 6056 kUsesArguments) |
6052 BOOL_ACCESSORS(SharedFunctionInfo, | 6057 BOOL_ACCESSORS(SharedFunctionInfo, |
6053 compiler_hints, | 6058 compiler_hints, |
6054 has_duplicate_parameters, | 6059 has_duplicate_parameters, |
6055 kHasDuplicateParameters) | 6060 kHasDuplicateParameters) |
6056 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) | 6061 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) |
6057 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) | 6062 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) |
6058 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_declaration, | 6063 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_declaration, |
6059 kIsDeclaration) | 6064 kIsDeclaration) |
6060 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, marked_for_tier_up, | 6065 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, marked_for_tier_up, |
6061 kMarkedForTierUp) | 6066 kMarkedForTierUp) |
6062 | 6067 |
6063 #if V8_HOST_ARCH_32_BIT | 6068 #if V8_HOST_ARCH_32_BIT |
6064 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) | 6069 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) |
6065 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, | 6070 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, |
6066 kFormalParameterCountOffset) | 6071 kFormalParameterCountOffset) |
6067 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, | 6072 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, |
6068 kExpectedNofPropertiesOffset) | 6073 kExpectedNofPropertiesOffset) |
6069 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 6074 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
6070 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, | 6075 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, |
6071 kStartPositionAndTypeOffset) | 6076 kStartPositionAndTypeOffset) |
6072 SMI_ACCESSORS(SharedFunctionInfo, end_position, kEndPositionOffset) | 6077 SMI_ACCESSORS(SharedFunctionInfo, end_position_and_is_blackboxed, |
| 6078 kEndPositionAndIsBlackboxedOffset) |
6073 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, | 6079 SMI_ACCESSORS(SharedFunctionInfo, function_token_position, |
6074 kFunctionTokenPositionOffset) | 6080 kFunctionTokenPositionOffset) |
6075 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, | 6081 SMI_ACCESSORS(SharedFunctionInfo, compiler_hints, |
6076 kCompilerHintsOffset) | 6082 kCompilerHintsOffset) |
6077 SMI_ACCESSORS(SharedFunctionInfo, opt_count_and_bailout_reason, | 6083 SMI_ACCESSORS(SharedFunctionInfo, opt_count_and_bailout_reason, |
6078 kOptCountAndBailoutReasonOffset) | 6084 kOptCountAndBailoutReasonOffset) |
6079 SMI_ACCESSORS(SharedFunctionInfo, counters, kCountersOffset) | 6085 SMI_ACCESSORS(SharedFunctionInfo, counters, kCountersOffset) |
6080 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) | 6086 SMI_ACCESSORS(SharedFunctionInfo, ast_node_count, kAstNodeCountOffset) |
6081 SMI_ACCESSORS(SharedFunctionInfo, profiler_ticks, kProfilerTicksOffset) | 6087 SMI_ACCESSORS(SharedFunctionInfo, profiler_ticks, kProfilerTicksOffset) |
6082 | 6088 |
(...skipping 28 matching lines...) Expand all Loading... |
6111 | 6117 |
6112 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, length, kLengthOffset) | 6118 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, length, kLengthOffset) |
6113 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, internal_formal_parameter_count, | 6119 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, internal_formal_parameter_count, |
6114 kFormalParameterCountOffset) | 6120 kFormalParameterCountOffset) |
6115 | 6121 |
6116 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | 6122 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
6117 expected_nof_properties, | 6123 expected_nof_properties, |
6118 kExpectedNofPropertiesOffset) | 6124 kExpectedNofPropertiesOffset) |
6119 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 6125 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
6120 | 6126 |
6121 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, end_position, kEndPositionOffset) | 6127 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, end_position_and_is_blackboxed, |
| 6128 kEndPositionAndIsBlackboxedOffset) |
6122 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, | 6129 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, |
6123 start_position_and_type, | 6130 start_position_and_type, |
6124 kStartPositionAndTypeOffset) | 6131 kStartPositionAndTypeOffset) |
6125 | 6132 |
6126 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, | 6133 PSEUDO_SMI_ACCESSORS_LO(SharedFunctionInfo, |
6127 function_token_position, | 6134 function_token_position, |
6128 kFunctionTokenPositionOffset) | 6135 kFunctionTokenPositionOffset) |
6129 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, | 6136 PSEUDO_SMI_ACCESSORS_HI(SharedFunctionInfo, |
6130 compiler_hints, | 6137 compiler_hints, |
6131 kCompilerHintsOffset) | 6138 kCompilerHintsOffset) |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6227 } | 6234 } |
6228 | 6235 |
6229 | 6236 |
6230 void SharedFunctionInfo::DontAdaptArguments() { | 6237 void SharedFunctionInfo::DontAdaptArguments() { |
6231 DCHECK(code()->kind() == Code::BUILTIN || code()->kind() == Code::STUB); | 6238 DCHECK(code()->kind() == Code::BUILTIN || code()->kind() == Code::STUB); |
6232 set_internal_formal_parameter_count(kDontAdaptArgumentsSentinel); | 6239 set_internal_formal_parameter_count(kDontAdaptArgumentsSentinel); |
6233 } | 6240 } |
6234 | 6241 |
6235 | 6242 |
6236 int SharedFunctionInfo::start_position() const { | 6243 int SharedFunctionInfo::start_position() const { |
6237 return start_position_and_type() >> kStartPositionShift; | 6244 return start_position_and_type() >> kPositionShift; |
6238 } | 6245 } |
6239 | 6246 |
6240 | 6247 |
6241 void SharedFunctionInfo::set_start_position(int start_position) { | 6248 void SharedFunctionInfo::set_start_position(int start_position) { |
6242 set_start_position_and_type((start_position << kStartPositionShift) | 6249 set_start_position_and_type((start_position << kPositionShift) | |
6243 | (start_position_and_type() & ~kStartPositionMask)); | 6250 (start_position_and_type() & ~kPositionMask)); |
| 6251 } |
| 6252 |
| 6253 int SharedFunctionInfo::end_position() const { |
| 6254 return end_position_and_is_blackboxed() >> kPositionShift; |
| 6255 } |
| 6256 |
| 6257 void SharedFunctionInfo::set_end_position(int end_position) { |
| 6258 set_end_position_and_is_blackboxed( |
| 6259 (end_position << kPositionShift) | |
| 6260 (end_position_and_is_blackboxed() & ~kPositionMask)); |
6244 } | 6261 } |
6245 | 6262 |
6246 | 6263 |
6247 Code* SharedFunctionInfo::code() const { | 6264 Code* SharedFunctionInfo::code() const { |
6248 return Code::cast(READ_FIELD(this, kCodeOffset)); | 6265 return Code::cast(READ_FIELD(this, kCodeOffset)); |
6249 } | 6266 } |
6250 | 6267 |
6251 | 6268 |
6252 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { | 6269 void SharedFunctionInfo::set_code(Code* value, WriteBarrierMode mode) { |
6253 DCHECK(value->kind() != Code::OPTIMIZED_FUNCTION); | 6270 DCHECK(value->kind() != Code::OPTIMIZED_FUNCTION); |
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8417 #undef WRITE_INT64_FIELD | 8434 #undef WRITE_INT64_FIELD |
8418 #undef READ_BYTE_FIELD | 8435 #undef READ_BYTE_FIELD |
8419 #undef WRITE_BYTE_FIELD | 8436 #undef WRITE_BYTE_FIELD |
8420 #undef NOBARRIER_READ_BYTE_FIELD | 8437 #undef NOBARRIER_READ_BYTE_FIELD |
8421 #undef NOBARRIER_WRITE_BYTE_FIELD | 8438 #undef NOBARRIER_WRITE_BYTE_FIELD |
8422 | 8439 |
8423 } // namespace internal | 8440 } // namespace internal |
8424 } // namespace v8 | 8441 } // namespace v8 |
8425 | 8442 |
8426 #endif // V8_OBJECTS_INL_H_ | 8443 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |