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 5126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5137 ACCESSORS(Script, id, Smi, kIdOffset) | 5137 ACCESSORS(Script, id, Smi, kIdOffset) |
5138 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) | 5138 ACCESSORS_TO_SMI(Script, line_offset, kLineOffsetOffset) |
5139 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) | 5139 ACCESSORS_TO_SMI(Script, column_offset, kColumnOffsetOffset) |
5140 ACCESSORS(Script, context_data, Object, kContextOffset) | 5140 ACCESSORS(Script, context_data, Object, kContextOffset) |
5141 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) | 5141 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) |
5142 ACCESSORS_TO_SMI(Script, type, kTypeOffset) | 5142 ACCESSORS_TO_SMI(Script, type, kTypeOffset) |
5143 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) | 5143 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) |
5144 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) | 5144 ACCESSORS(Script, eval_from_shared, Object, kEvalFromSharedOffset) |
5145 ACCESSORS_TO_SMI(Script, eval_from_instructions_offset, | 5145 ACCESSORS_TO_SMI(Script, eval_from_instructions_offset, |
5146 kEvalFrominstructionsOffsetOffset) | 5146 kEvalFrominstructionsOffsetOffset) |
| 5147 ACCESSORS(Script, shared_function_infos, Object, kSharedFunctionInfosOffset) |
5147 ACCESSORS_TO_SMI(Script, flags, kFlagsOffset) | 5148 ACCESSORS_TO_SMI(Script, flags, kFlagsOffset) |
5148 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) | 5149 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) |
5149 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) | 5150 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) |
5150 | 5151 |
5151 Script::CompilationType Script::compilation_type() { | 5152 Script::CompilationType Script::compilation_type() { |
5152 return BooleanBit::get(flags(), kCompilationTypeBit) ? | 5153 return BooleanBit::get(flags(), kCompilationTypeBit) ? |
5153 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; | 5154 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; |
5154 } | 5155 } |
5155 void Script::set_compilation_type(CompilationType type) { | 5156 void Script::set_compilation_type(CompilationType type) { |
5156 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, | 5157 set_flags(BooleanBit::set(flags(), kCompilationTypeBit, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5231 BOOL_ACCESSORS(SharedFunctionInfo, | 5232 BOOL_ACCESSORS(SharedFunctionInfo, |
5232 compiler_hints, | 5233 compiler_hints, |
5233 uses_arguments, | 5234 uses_arguments, |
5234 kUsesArguments) | 5235 kUsesArguments) |
5235 BOOL_ACCESSORS(SharedFunctionInfo, | 5236 BOOL_ACCESSORS(SharedFunctionInfo, |
5236 compiler_hints, | 5237 compiler_hints, |
5237 has_duplicate_parameters, | 5238 has_duplicate_parameters, |
5238 kHasDuplicateParameters) | 5239 kHasDuplicateParameters) |
5239 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) | 5240 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) |
5240 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) | 5241 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) |
| 5242 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, never_compiled, |
| 5243 kNeverCompiled) |
5241 | 5244 |
5242 | 5245 |
5243 #if V8_HOST_ARCH_32_BIT | 5246 #if V8_HOST_ARCH_32_BIT |
5244 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) | 5247 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) |
5245 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, | 5248 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, |
5246 kFormalParameterCountOffset) | 5249 kFormalParameterCountOffset) |
5247 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, | 5250 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, |
5248 kExpectedNofPropertiesOffset) | 5251 kExpectedNofPropertiesOffset) |
5249 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) | 5252 SMI_ACCESSORS(SharedFunctionInfo, num_literals, kNumLiteralsOffset) |
5250 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, | 5253 SMI_ACCESSORS(SharedFunctionInfo, start_position_and_type, |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5445 // If the GC metadata field is already used then the function was | 5448 // If the GC metadata field is already used then the function was |
5446 // enqueued as a code flushing candidate and we remove it now. | 5449 // enqueued as a code flushing candidate and we remove it now. |
5447 if (code()->gc_metadata() != NULL) { | 5450 if (code()->gc_metadata() != NULL) { |
5448 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); | 5451 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); |
5449 flusher->EvictCandidate(this); | 5452 flusher->EvictCandidate(this); |
5450 } | 5453 } |
5451 | 5454 |
5452 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL); | 5455 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL); |
5453 | 5456 |
5454 set_code(value); | 5457 set_code(value); |
| 5458 |
| 5459 if (is_compiled()) set_never_compiled(false); |
5455 } | 5460 } |
5456 | 5461 |
5457 | 5462 |
5458 ScopeInfo* SharedFunctionInfo::scope_info() const { | 5463 ScopeInfo* SharedFunctionInfo::scope_info() const { |
5459 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset)); | 5464 return reinterpret_cast<ScopeInfo*>(READ_FIELD(this, kScopeInfoOffset)); |
5460 } | 5465 } |
5461 | 5466 |
5462 | 5467 |
5463 void SharedFunctionInfo::set_scope_info(ScopeInfo* value, | 5468 void SharedFunctionInfo::set_scope_info(ScopeInfo* value, |
5464 WriteBarrierMode mode) { | 5469 WriteBarrierMode mode) { |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7292 #undef READ_SHORT_FIELD | 7297 #undef READ_SHORT_FIELD |
7293 #undef WRITE_SHORT_FIELD | 7298 #undef WRITE_SHORT_FIELD |
7294 #undef READ_BYTE_FIELD | 7299 #undef READ_BYTE_FIELD |
7295 #undef WRITE_BYTE_FIELD | 7300 #undef WRITE_BYTE_FIELD |
7296 #undef NOBARRIER_READ_BYTE_FIELD | 7301 #undef NOBARRIER_READ_BYTE_FIELD |
7297 #undef NOBARRIER_WRITE_BYTE_FIELD | 7302 #undef NOBARRIER_WRITE_BYTE_FIELD |
7298 | 7303 |
7299 } } // namespace v8::internal | 7304 } } // namespace v8::internal |
7300 | 7305 |
7301 #endif // V8_OBJECTS_INL_H_ | 7306 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |