Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: src/objects-inl.h

Issue 2547483002: Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 5915 matching lines...) Expand 10 before | Expand all | Expand 10 after
5926 SMI_ACCESSORS(Script, line_offset, kLineOffsetOffset) 5926 SMI_ACCESSORS(Script, line_offset, kLineOffsetOffset)
5927 SMI_ACCESSORS(Script, column_offset, kColumnOffsetOffset) 5927 SMI_ACCESSORS(Script, column_offset, kColumnOffsetOffset)
5928 ACCESSORS(Script, context_data, Object, kContextOffset) 5928 ACCESSORS(Script, context_data, Object, kContextOffset)
5929 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset) 5929 ACCESSORS(Script, wrapper, HeapObject, kWrapperOffset)
5930 SMI_ACCESSORS(Script, type, kTypeOffset) 5930 SMI_ACCESSORS(Script, type, kTypeOffset)
5931 ACCESSORS(Script, line_ends, Object, kLineEndsOffset) 5931 ACCESSORS(Script, line_ends, Object, kLineEndsOffset)
5932 ACCESSORS_CHECKED(Script, eval_from_shared, Object, kEvalFromSharedOffset, 5932 ACCESSORS_CHECKED(Script, eval_from_shared, Object, kEvalFromSharedOffset,
5933 this->type() != TYPE_WASM) 5933 this->type() != TYPE_WASM)
5934 SMI_ACCESSORS_CHECKED(Script, eval_from_position, kEvalFromPositionOffset, 5934 SMI_ACCESSORS_CHECKED(Script, eval_from_position, kEvalFromPositionOffset,
5935 this->type() != TYPE_WASM) 5935 this->type() != TYPE_WASM)
5936 ACCESSORS(Script, shared_function_infos, Object, kSharedFunctionInfosOffset) 5936 ACCESSORS(Script, shared_function_infos, FixedArray, kSharedFunctionInfosOffset)
5937 SMI_ACCESSORS(Script, flags, kFlagsOffset) 5937 SMI_ACCESSORS(Script, flags, kFlagsOffset)
5938 ACCESSORS(Script, source_url, Object, kSourceUrlOffset) 5938 ACCESSORS(Script, source_url, Object, kSourceUrlOffset)
5939 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset) 5939 ACCESSORS(Script, source_mapping_url, Object, kSourceMappingUrlOffset)
5940 ACCESSORS_CHECKED(Script, wasm_compiled_module, Object, kEvalFromSharedOffset, 5940 ACCESSORS_CHECKED(Script, wasm_compiled_module, Object, kEvalFromSharedOffset,
5941 this->type() == TYPE_WASM) 5941 this->type() == TYPE_WASM)
5942 5942
5943 Script::CompilationType Script::compilation_type() { 5943 Script::CompilationType Script::compilation_type() {
5944 return BooleanBit::get(flags(), kCompilationTypeBit) ? 5944 return BooleanBit::get(flags(), kCompilationTypeBit) ?
5945 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST; 5945 COMPILATION_TYPE_EVAL : COMPILATION_TYPE_HOST;
5946 } 5946 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
6042 BOOL_ACCESSORS(SharedFunctionInfo, 6042 BOOL_ACCESSORS(SharedFunctionInfo,
6043 compiler_hints, 6043 compiler_hints,
6044 uses_arguments, 6044 uses_arguments,
6045 kUsesArguments) 6045 kUsesArguments)
6046 BOOL_ACCESSORS(SharedFunctionInfo, 6046 BOOL_ACCESSORS(SharedFunctionInfo,
6047 compiler_hints, 6047 compiler_hints,
6048 has_duplicate_parameters, 6048 has_duplicate_parameters,
6049 kHasDuplicateParameters) 6049 kHasDuplicateParameters)
6050 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction) 6050 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, asm_function, kIsAsmFunction)
6051 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized) 6051 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, deserialized, kDeserialized)
6052 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, never_compiled,
6053 kNeverCompiled)
6054 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_declaration, 6052 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, is_declaration,
6055 kIsDeclaration) 6053 kIsDeclaration)
6056 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, marked_for_tier_up, 6054 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, marked_for_tier_up,
6057 kMarkedForTierUp) 6055 kMarkedForTierUp)
6058 6056
6059 #if V8_HOST_ARCH_32_BIT 6057 #if V8_HOST_ARCH_32_BIT
6060 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset) 6058 SMI_ACCESSORS(SharedFunctionInfo, length, kLengthOffset)
6061 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count, 6059 SMI_ACCESSORS(SharedFunctionInfo, internal_formal_parameter_count,
6062 kFormalParameterCountOffset) 6060 kFormalParameterCountOffset)
6063 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties, 6061 SMI_ACCESSORS(SharedFunctionInfo, expected_nof_properties,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
6264 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher(); 6262 CodeFlusher* flusher = GetHeap()->mark_compact_collector()->code_flusher();
6265 flusher->EvictCandidate(this); 6263 flusher->EvictCandidate(this);
6266 } 6264 }
6267 6265
6268 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL); 6266 DCHECK(code()->gc_metadata() == NULL && value->gc_metadata() == NULL);
6269 #ifdef DEBUG 6267 #ifdef DEBUG
6270 Code::VerifyRecompiledCode(code(), value); 6268 Code::VerifyRecompiledCode(code(), value);
6271 #endif // DEBUG 6269 #endif // DEBUG
6272 6270
6273 set_code(value); 6271 set_code(value);
6274
6275 if (is_compiled()) set_never_compiled(false);
6276 } 6272 }
6277 6273
6278 bool SharedFunctionInfo::IsInterpreted() const { 6274 bool SharedFunctionInfo::IsInterpreted() const {
6279 return code()->is_interpreter_trampoline_builtin(); 6275 return code()->is_interpreter_trampoline_builtin();
6280 } 6276 }
6281 6277
6282 bool SharedFunctionInfo::HasBaselineCode() const { 6278 bool SharedFunctionInfo::HasBaselineCode() const {
6283 return code()->kind() == Code::FUNCTION; 6279 return code()->kind() == Code::FUNCTION;
6284 } 6280 }
6285 6281
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
8449 #undef WRITE_INT64_FIELD 8445 #undef WRITE_INT64_FIELD
8450 #undef READ_BYTE_FIELD 8446 #undef READ_BYTE_FIELD
8451 #undef WRITE_BYTE_FIELD 8447 #undef WRITE_BYTE_FIELD
8452 #undef NOBARRIER_READ_BYTE_FIELD 8448 #undef NOBARRIER_READ_BYTE_FIELD
8453 #undef NOBARRIER_WRITE_BYTE_FIELD 8449 #undef NOBARRIER_WRITE_BYTE_FIELD
8454 8450
8455 } // namespace internal 8451 } // namespace internal
8456 } // namespace v8 8452 } // namespace v8
8457 8453
8458 #endif // V8_OBJECTS_INL_H_ 8454 #endif // V8_OBJECTS_INL_H_
OLDNEW
« src/debug/liveedit.js ('K') | « src/objects.cc ('k') | src/parsing/parse-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698