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