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

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

Issue 2095673002: Share SharedFunctionInfo between all functions created for a FunctionTemplateInfo (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months 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
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5483 matching lines...) Expand 10 before | Expand all | Expand 10 after
5494 Handle<Map> map) { 5494 Handle<Map> map) {
5495 Handle<WeakCell> cell = Map::WeakCellForMap(map); 5495 Handle<WeakCell> cell = Map::WeakCellForMap(map);
5496 info->set_object_create_map(*cell); 5496 info->set_object_create_map(*cell);
5497 } 5497 }
5498 5498
5499 bool PrototypeInfo::HasObjectCreateMap() { 5499 bool PrototypeInfo::HasObjectCreateMap() {
5500 Object* cache = object_create_map(); 5500 Object* cache = object_create_map();
5501 return cache->IsWeakCell() && !WeakCell::cast(cache)->cleared(); 5501 return cache->IsWeakCell() && !WeakCell::cast(cache)->cleared();
5502 } 5502 }
5503 5503
5504 bool FunctionTemplateInfo::instantiated() {
5505 return shared_function_info()->IsSharedFunctionInfo();
5506 }
5507
5504 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset) 5508 ACCESSORS(PrototypeInfo, prototype_users, Object, kPrototypeUsersOffset)
5505 ACCESSORS(PrototypeInfo, object_create_map, Object, kObjectCreateMap) 5509 ACCESSORS(PrototypeInfo, object_create_map, Object, kObjectCreateMap)
5506 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset) 5510 SMI_ACCESSORS(PrototypeInfo, registry_slot, kRegistrySlotOffset)
5507 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset) 5511 ACCESSORS(PrototypeInfo, validity_cell, Object, kValidityCellOffset)
5508 SMI_ACCESSORS(PrototypeInfo, bit_field, kBitFieldOffset) 5512 SMI_ACCESSORS(PrototypeInfo, bit_field, kBitFieldOffset)
5509 BOOL_ACCESSORS(PrototypeInfo, bit_field, should_be_fast_map, kShouldBeFastBit) 5513 BOOL_ACCESSORS(PrototypeInfo, bit_field, should_be_fast_map, kShouldBeFastBit)
5510 5514
5511 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo, 5515 ACCESSORS(SloppyBlockWithEvalContextExtension, scope_info, ScopeInfo,
5512 kScopeInfoOffset) 5516 kScopeInfoOffset)
5513 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject, 5517 ACCESSORS(SloppyBlockWithEvalContextExtension, extension, JSObject,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
5550 ACCESSORS(FunctionTemplateInfo, indexed_property_handler, Object, 5554 ACCESSORS(FunctionTemplateInfo, indexed_property_handler, Object,
5551 kIndexedPropertyHandlerOffset) 5555 kIndexedPropertyHandlerOffset)
5552 ACCESSORS(FunctionTemplateInfo, instance_template, Object, 5556 ACCESSORS(FunctionTemplateInfo, instance_template, Object,
5553 kInstanceTemplateOffset) 5557 kInstanceTemplateOffset)
5554 ACCESSORS(FunctionTemplateInfo, class_name, Object, kClassNameOffset) 5558 ACCESSORS(FunctionTemplateInfo, class_name, Object, kClassNameOffset)
5555 ACCESSORS(FunctionTemplateInfo, signature, Object, kSignatureOffset) 5559 ACCESSORS(FunctionTemplateInfo, signature, Object, kSignatureOffset)
5556 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object, 5560 ACCESSORS(FunctionTemplateInfo, instance_call_handler, Object,
5557 kInstanceCallHandlerOffset) 5561 kInstanceCallHandlerOffset)
5558 ACCESSORS(FunctionTemplateInfo, access_check_info, Object, 5562 ACCESSORS(FunctionTemplateInfo, access_check_info, Object,
5559 kAccessCheckInfoOffset) 5563 kAccessCheckInfoOffset)
5564 ACCESSORS(FunctionTemplateInfo, shared_function_info, Object,
5565 kSharedFunctionInfoOffset)
5566
5560 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset) 5567 SMI_ACCESSORS(FunctionTemplateInfo, flag, kFlagOffset)
5561 5568
5562 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset) 5569 ACCESSORS(ObjectTemplateInfo, constructor, Object, kConstructorOffset)
5563 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object, 5570 ACCESSORS(ObjectTemplateInfo, internal_field_count, Object,
5564 kInternalFieldCountOffset) 5571 kInternalFieldCountOffset)
5565 5572
5566 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset) 5573 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset)
5567 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset) 5574 ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset)
5568 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset) 5575 SMI_ACCESSORS(AllocationSite, pretenure_data, kPretenureDataOffset)
5569 SMI_ACCESSORS(AllocationSite, pretenure_create_count, 5576 SMI_ACCESSORS(AllocationSite, pretenure_create_count,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
5655 kHiddenPrototypeBit) 5662 kHiddenPrototypeBit)
5656 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit) 5663 BOOL_ACCESSORS(FunctionTemplateInfo, flag, undetectable, kUndetectableBit)
5657 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check, 5664 BOOL_ACCESSORS(FunctionTemplateInfo, flag, needs_access_check,
5658 kNeedsAccessCheckBit) 5665 kNeedsAccessCheckBit)
5659 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype, 5666 BOOL_ACCESSORS(FunctionTemplateInfo, flag, read_only_prototype,
5660 kReadOnlyPrototypeBit) 5667 kReadOnlyPrototypeBit)
5661 BOOL_ACCESSORS(FunctionTemplateInfo, flag, remove_prototype, 5668 BOOL_ACCESSORS(FunctionTemplateInfo, flag, remove_prototype,
5662 kRemovePrototypeBit) 5669 kRemovePrototypeBit)
5663 BOOL_ACCESSORS(FunctionTemplateInfo, flag, do_not_cache, 5670 BOOL_ACCESSORS(FunctionTemplateInfo, flag, do_not_cache,
5664 kDoNotCacheBit) 5671 kDoNotCacheBit)
5665 BOOL_ACCESSORS(FunctionTemplateInfo, flag, instantiated, kInstantiatedBit)
5666 BOOL_ACCESSORS(FunctionTemplateInfo, flag, accept_any_receiver, 5672 BOOL_ACCESSORS(FunctionTemplateInfo, flag, accept_any_receiver,
5667 kAcceptAnyReceiver) 5673 kAcceptAnyReceiver)
5668 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_named_expression, 5674 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_named_expression,
5669 kIsNamedExpressionBit) 5675 kIsNamedExpressionBit)
5670 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel, 5676 BOOL_ACCESSORS(SharedFunctionInfo, start_position_and_type, is_toplevel,
5671 kIsTopLevelBit) 5677 kIsTopLevelBit)
5672 5678
5673 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, allows_lazy_compilation, 5679 BOOL_ACCESSORS(SharedFunctionInfo, compiler_hints, allows_lazy_compilation,
5674 kAllowLazyCompilation) 5680 kAllowLazyCompilation)
5675 BOOL_ACCESSORS(SharedFunctionInfo, 5681 BOOL_ACCESSORS(SharedFunctionInfo,
(...skipping 2270 matching lines...) Expand 10 before | Expand all | Expand 10 after
7946 #undef WRITE_INT64_FIELD 7952 #undef WRITE_INT64_FIELD
7947 #undef READ_BYTE_FIELD 7953 #undef READ_BYTE_FIELD
7948 #undef WRITE_BYTE_FIELD 7954 #undef WRITE_BYTE_FIELD
7949 #undef NOBARRIER_READ_BYTE_FIELD 7955 #undef NOBARRIER_READ_BYTE_FIELD
7950 #undef NOBARRIER_WRITE_BYTE_FIELD 7956 #undef NOBARRIER_WRITE_BYTE_FIELD
7951 7957
7952 } // namespace internal 7958 } // namespace internal
7953 } // namespace v8 7959 } // namespace v8
7954 7960
7955 #endif // V8_OBJECTS_INL_H_ 7961 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698