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

Side by Side Diff: src/objects.h

Issue 148593004: A64: Synchronize with r18084. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/mksnapshot.cc ('k') | src/objects.cc » ('j') | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 inline void set_##name(bool value); \ 856 inline void set_##name(bool value); \
857 857
858 858
859 #define DECL_ACCESSORS(name, type) \ 859 #define DECL_ACCESSORS(name, type) \
860 inline type* name(); \ 860 inline type* name(); \
861 inline void set_##name(type* value, \ 861 inline void set_##name(type* value, \
862 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \ 862 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \
863 863
864 class AccessorPair; 864 class AccessorPair;
865 class AllocationSite; 865 class AllocationSite;
866 class AllocationSiteContext; 866 class AllocationSiteCreationContext;
867 class AllocationSiteUsageContext;
867 class DictionaryElementsAccessor; 868 class DictionaryElementsAccessor;
868 class ElementsAccessor; 869 class ElementsAccessor;
869 class Failure; 870 class Failure;
870 class FixedArrayBase; 871 class FixedArrayBase;
871 class ObjectVisitor; 872 class ObjectVisitor;
872 class StringStream; 873 class StringStream;
873 class Type; 874 class Type;
874 875
875 876
876 // A template-ized version of the IsXXX functions. 877 // A template-ized version of the IsXXX functions.
(...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after
2555 // Disalow further properties to be added to the object. 2556 // Disalow further properties to be added to the object.
2556 static Handle<Object> PreventExtensions(Handle<JSObject> object); 2557 static Handle<Object> PreventExtensions(Handle<JSObject> object);
2557 2558
2558 // ES5 Object.freeze 2559 // ES5 Object.freeze
2559 static Handle<Object> Freeze(Handle<JSObject> object); 2560 static Handle<Object> Freeze(Handle<JSObject> object);
2560 2561
2561 // Called the first time an object is observed with ES7 Object.observe. 2562 // Called the first time an object is observed with ES7 Object.observe.
2562 static void SetObserved(Handle<JSObject> object); 2563 static void SetObserved(Handle<JSObject> object);
2563 2564
2564 // Copy object. 2565 // Copy object.
2565 static Handle<JSObject> Copy(Handle<JSObject> object, 2566 enum DeepCopyHints {
2566 Handle<AllocationSite> site); 2567 kNoHints = 0,
2568 kObjectIsShallowArray = 1
2569 };
2570
2567 static Handle<JSObject> Copy(Handle<JSObject> object); 2571 static Handle<JSObject> Copy(Handle<JSObject> object);
2568 static Handle<JSObject> DeepCopy(Handle<JSObject> object, 2572 static Handle<JSObject> DeepCopy(Handle<JSObject> object,
2569 AllocationSiteContext* site_context); 2573 AllocationSiteUsageContext* site_context,
2574 DeepCopyHints hints = kNoHints);
2570 static Handle<JSObject> DeepWalk(Handle<JSObject> object, 2575 static Handle<JSObject> DeepWalk(Handle<JSObject> object,
2571 AllocationSiteContext* site_context); 2576 AllocationSiteCreationContext* site_context);
2572 2577
2573 // Casting. 2578 // Casting.
2574 static inline JSObject* cast(Object* obj); 2579 static inline JSObject* cast(Object* obj);
2575 2580
2576 // Dispatched behavior. 2581 // Dispatched behavior.
2577 void JSObjectShortPrint(StringStream* accumulator); 2582 void JSObjectShortPrint(StringStream* accumulator);
2578 DECLARE_PRINTER(JSObject) 2583 DECLARE_PRINTER(JSObject)
2579 DECLARE_VERIFIER(JSObject) 2584 DECLARE_VERIFIER(JSObject)
2580 #ifdef OBJECT_PRINT 2585 #ifdef OBJECT_PRINT
2581 void PrintProperties(FILE* out = stdout); 2586 void PrintProperties(FILE* out = stdout);
(...skipping 2506 matching lines...) Expand 10 before | Expand all | Expand 10 after
5088 void Disassemble(const char* name, FILE* out = stdout); 5093 void Disassemble(const char* name, FILE* out = stdout);
5089 #endif // ENABLE_DISASSEMBLER 5094 #endif // ENABLE_DISASSEMBLER
5090 5095
5091 // [instruction_size]: Size of the native instructions 5096 // [instruction_size]: Size of the native instructions
5092 inline int instruction_size(); 5097 inline int instruction_size();
5093 inline void set_instruction_size(int value); 5098 inline void set_instruction_size(int value);
5094 5099
5095 // [relocation_info]: Code relocation information 5100 // [relocation_info]: Code relocation information
5096 DECL_ACCESSORS(relocation_info, ByteArray) 5101 DECL_ACCESSORS(relocation_info, ByteArray)
5097 void InvalidateRelocation(); 5102 void InvalidateRelocation();
5103 void InvalidateEmbeddedObjects();
5098 5104
5099 // [handler_table]: Fixed array containing offsets of exception handlers. 5105 // [handler_table]: Fixed array containing offsets of exception handlers.
5100 DECL_ACCESSORS(handler_table, FixedArray) 5106 DECL_ACCESSORS(handler_table, FixedArray)
5101 5107
5102 // [deoptimization_data]: Array containing data for deopt. 5108 // [deoptimization_data]: Array containing data for deopt.
5103 DECL_ACCESSORS(deoptimization_data, FixedArray) 5109 DECL_ACCESSORS(deoptimization_data, FixedArray)
5104 5110
5105 // [raw_type_feedback_info]: This field stores various things, depending on 5111 // [raw_type_feedback_info]: This field stores various things, depending on
5106 // the kind of the code object. 5112 // the kind of the code object.
5107 // FUNCTION => type feedback information. 5113 // FUNCTION => type feedback information.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
5175 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; } 5181 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; }
5176 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; } 5182 inline bool is_binary_op_stub() { return kind() == BINARY_OP_IC; }
5177 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; } 5183 inline bool is_compare_ic_stub() { return kind() == COMPARE_IC; }
5178 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; } 5184 inline bool is_compare_nil_ic_stub() { return kind() == COMPARE_NIL_IC; }
5179 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; } 5185 inline bool is_to_boolean_ic_stub() { return kind() == TO_BOOLEAN_IC; }
5180 inline bool is_keyed_stub(); 5186 inline bool is_keyed_stub();
5181 5187
5182 // [major_key]: For kind STUB or BINARY_OP_IC, the major key. 5188 // [major_key]: For kind STUB or BINARY_OP_IC, the major key.
5183 inline int major_key(); 5189 inline int major_key();
5184 inline void set_major_key(int value); 5190 inline void set_major_key(int value);
5191 inline bool has_major_key();
5185 5192
5186 // For kind STUB or ICs, tells whether or not a code object was generated by 5193 // For kind STUB or ICs, tells whether or not a code object was generated by
5187 // the optimizing compiler (but it may not be an optimized function). 5194 // the optimizing compiler (but it may not be an optimized function).
5188 bool is_crankshafted(); 5195 bool is_crankshafted();
5189 inline void set_is_crankshafted(bool value); 5196 inline void set_is_crankshafted(bool value);
5190 5197
5191 // For stubs, tells whether they should always exist, so that they can be 5198 // For stubs, tells whether they should always exist, so that they can be
5192 // called from other stubs. 5199 // called from other stubs.
5193 inline bool is_pregenerated(); 5200 inline bool is_pregenerated();
5194 inline void set_is_pregenerated(bool value); 5201 inline void set_is_pregenerated(bool value);
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
6230 6237
6231 bool CanTransition() { 6238 bool CanTransition() {
6232 // Only JSObject and subtypes have map transitions and back pointers. 6239 // Only JSObject and subtypes have map transitions and back pointers.
6233 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); 6240 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE);
6234 return instance_type() >= FIRST_JS_OBJECT_TYPE; 6241 return instance_type() >= FIRST_JS_OBJECT_TYPE;
6235 } 6242 }
6236 6243
6237 bool IsJSObjectMap() { 6244 bool IsJSObjectMap() {
6238 return instance_type() >= FIRST_JS_OBJECT_TYPE; 6245 return instance_type() >= FIRST_JS_OBJECT_TYPE;
6239 } 6246 }
6247 bool IsJSGlobalProxyMap() {
6248 return instance_type() == JS_GLOBAL_PROXY_TYPE;
6249 }
6250 bool IsJSGlobalObjectMap() {
6251 return instance_type() == JS_GLOBAL_OBJECT_TYPE;
6252 }
6253 bool IsGlobalObjectMap() {
6254 const InstanceType type = instance_type();
6255 return type == JS_GLOBAL_OBJECT_TYPE || type == JS_BUILTINS_OBJECT_TYPE;
6256 }
6240 6257
6241 // Fires when the layout of an object with a leaf map changes. 6258 // Fires when the layout of an object with a leaf map changes.
6242 // This includes adding transitions to the leaf map or changing 6259 // This includes adding transitions to the leaf map or changing
6243 // the descriptor array. 6260 // the descriptor array.
6244 inline void NotifyLeafMapLayoutChange(); 6261 inline void NotifyLeafMapLayoutChange();
6245 6262
6246 inline bool CanOmitMapChecks(); 6263 inline bool CanOmitMapChecks();
6247 6264
6248 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, 6265 void AddDependentCompilationInfo(DependentCode::DependencyGroup group,
6249 CompilationInfo* info); 6266 CompilationInfo* info);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
6540 V(Math, log, MathLog) \ 6557 V(Math, log, MathLog) \
6541 V(Math, sin, MathSin) \ 6558 V(Math, sin, MathSin) \
6542 V(Math, cos, MathCos) \ 6559 V(Math, cos, MathCos) \
6543 V(Math, tan, MathTan) \ 6560 V(Math, tan, MathTan) \
6544 V(Math, asin, MathASin) \ 6561 V(Math, asin, MathASin) \
6545 V(Math, acos, MathACos) \ 6562 V(Math, acos, MathACos) \
6546 V(Math, atan, MathATan) \ 6563 V(Math, atan, MathATan) \
6547 V(Math, exp, MathExp) \ 6564 V(Math, exp, MathExp) \
6548 V(Math, sqrt, MathSqrt) \ 6565 V(Math, sqrt, MathSqrt) \
6549 V(Math, pow, MathPow) \ 6566 V(Math, pow, MathPow) \
6550 V(Math, random, MathRandom) \
6551 V(Math, max, MathMax) \ 6567 V(Math, max, MathMax) \
6552 V(Math, min, MathMin) \ 6568 V(Math, min, MathMin) \
6553 V(Math, imul, MathImul) 6569 V(Math, imul, MathImul)
6554 6570
6555 enum BuiltinFunctionId { 6571 enum BuiltinFunctionId {
6556 kArrayCode, 6572 kArrayCode,
6557 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \ 6573 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \
6558 k##name, 6574 k##name,
6559 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID) 6575 FUNCTIONS_WITH_ID_LIST(DECLARE_FUNCTION_ID)
6560 #undef DECLARE_FUNCTION_ID 6576 #undef DECLARE_FUNCTION_ID
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
8144 8160
8145 class AllocationSite: public Struct { 8161 class AllocationSite: public Struct {
8146 public: 8162 public:
8147 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024; 8163 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
8148 8164
8149 DECL_ACCESSORS(transition_info, Object) 8165 DECL_ACCESSORS(transition_info, Object)
8150 // nested_site threads a list of sites that represent nested literals 8166 // nested_site threads a list of sites that represent nested literals
8151 // walked in a particular order. So [[1, 2], 1, 2] will have one 8167 // walked in a particular order. So [[1, 2], 1, 2] will have one
8152 // nested_site, but [[1, 2], 3, [4]] will have a list of two. 8168 // nested_site, but [[1, 2], 3, [4]] will have a list of two.
8153 DECL_ACCESSORS(nested_site, Object) 8169 DECL_ACCESSORS(nested_site, Object)
8170 DECL_ACCESSORS(memento_found_count, Smi)
8171 DECL_ACCESSORS(memento_create_count, Smi)
8172 DECL_ACCESSORS(pretenure_decision, Smi)
8154 DECL_ACCESSORS(dependent_code, DependentCode) 8173 DECL_ACCESSORS(dependent_code, DependentCode)
8155 DECL_ACCESSORS(weak_next, Object) 8174 DECL_ACCESSORS(weak_next, Object)
8156 8175
8157 inline void Initialize(); 8176 inline void Initialize();
8158 8177
8159 bool HasNestedSites() { 8178 bool HasNestedSites() {
8160 return nested_site()->IsAllocationSite(); 8179 return nested_site()->IsAllocationSite();
8161 } 8180 }
8162 8181
8163 // This method is expensive, it should only be called for reporting. 8182 // This method is expensive, it should only be called for reporting.
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
8211 DECLARE_VERIFIER(AllocationSite) 8230 DECLARE_VERIFIER(AllocationSite)
8212 8231
8213 static inline AllocationSite* cast(Object* obj); 8232 static inline AllocationSite* cast(Object* obj);
8214 static inline AllocationSiteMode GetMode( 8233 static inline AllocationSiteMode GetMode(
8215 ElementsKind boilerplate_elements_kind); 8234 ElementsKind boilerplate_elements_kind);
8216 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to); 8235 static inline AllocationSiteMode GetMode(ElementsKind from, ElementsKind to);
8217 static inline bool CanTrack(InstanceType type); 8236 static inline bool CanTrack(InstanceType type);
8218 8237
8219 static const int kTransitionInfoOffset = HeapObject::kHeaderSize; 8238 static const int kTransitionInfoOffset = HeapObject::kHeaderSize;
8220 static const int kNestedSiteOffset = kTransitionInfoOffset + kPointerSize; 8239 static const int kNestedSiteOffset = kTransitionInfoOffset + kPointerSize;
8221 static const int kDependentCodeOffset = kNestedSiteOffset + kPointerSize; 8240 static const int kMementoFoundCountOffset = kNestedSiteOffset + kPointerSize;
8241 static const int kMementoCreateCountOffset =
8242 kMementoFoundCountOffset + kPointerSize;
8243 static const int kPretenureDecisionOffset =
8244 kMementoCreateCountOffset + kPointerSize;
8245 static const int kDependentCodeOffset =
8246 kPretenureDecisionOffset + kPointerSize;
8222 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize; 8247 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize;
8223 static const int kSize = kWeakNextOffset + kPointerSize; 8248 static const int kSize = kWeakNextOffset + kPointerSize;
8224 8249
8225 // During mark compact we need to take special care for the dependent code 8250 // During mark compact we need to take special care for the dependent code
8226 // field. 8251 // field.
8227 static const int kPointerFieldsBeginOffset = kTransitionInfoOffset; 8252 static const int kPointerFieldsBeginOffset = kTransitionInfoOffset;
8228 static const int kPointerFieldsEndOffset = kDependentCodeOffset; 8253 static const int kPointerFieldsEndOffset = kDependentCodeOffset;
8229 8254
8230 // For other visitors, use the fixed body descriptor below. 8255 // For other visitors, use the fixed body descriptor below.
8231 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, 8256 typedef FixedBodyDescriptor<HeapObject::kHeaderSize,
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after
9654 9679
9655 // [byte_length]: length in bytes 9680 // [byte_length]: length in bytes
9656 DECL_ACCESSORS(byte_length, Object) 9681 DECL_ACCESSORS(byte_length, Object)
9657 9682
9658 // [flags] 9683 // [flags]
9659 DECL_ACCESSORS(flag, Smi) 9684 DECL_ACCESSORS(flag, Smi)
9660 9685
9661 inline bool is_external(); 9686 inline bool is_external();
9662 inline void set_is_external(bool value); 9687 inline void set_is_external(bool value);
9663 9688
9689 inline bool should_be_freed();
9690 inline void set_should_be_freed(bool value);
9691
9664 // [weak_next]: linked list of array buffers. 9692 // [weak_next]: linked list of array buffers.
9665 DECL_ACCESSORS(weak_next, Object) 9693 DECL_ACCESSORS(weak_next, Object)
9666 9694
9667 // [weak_first_array]: weak linked list of views. 9695 // [weak_first_array]: weak linked list of views.
9668 DECL_ACCESSORS(weak_first_view, Object) 9696 DECL_ACCESSORS(weak_first_view, Object)
9669 9697
9670 // Casting. 9698 // Casting.
9671 static inline JSArrayBuffer* cast(Object* obj); 9699 static inline JSArrayBuffer* cast(Object* obj);
9672 9700
9673 // Neutering. Only neuters the buffer, not associated typed arrays. 9701 // Neutering. Only neuters the buffer, not associated typed arrays.
9674 void Neuter(); 9702 void Neuter();
9675 9703
9676 // Dispatched behavior. 9704 // Dispatched behavior.
9677 DECLARE_PRINTER(JSArrayBuffer) 9705 DECLARE_PRINTER(JSArrayBuffer)
9678 DECLARE_VERIFIER(JSArrayBuffer) 9706 DECLARE_VERIFIER(JSArrayBuffer)
9679 9707
9680 static const int kBackingStoreOffset = JSObject::kHeaderSize; 9708 static const int kBackingStoreOffset = JSObject::kHeaderSize;
9681 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize; 9709 static const int kByteLengthOffset = kBackingStoreOffset + kPointerSize;
9682 static const int kFlagOffset = kByteLengthOffset + kPointerSize; 9710 static const int kFlagOffset = kByteLengthOffset + kPointerSize;
9683 static const int kWeakNextOffset = kFlagOffset + kPointerSize; 9711 static const int kWeakNextOffset = kFlagOffset + kPointerSize;
9684 static const int kWeakFirstViewOffset = kWeakNextOffset + kPointerSize; 9712 static const int kWeakFirstViewOffset = kWeakNextOffset + kPointerSize;
9685 static const int kSize = kWeakFirstViewOffset + kPointerSize; 9713 static const int kSize = kWeakFirstViewOffset + kPointerSize;
9686 9714
9687 static const int kSizeWithInternalFields = 9715 static const int kSizeWithInternalFields =
9688 kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize; 9716 kSize + v8::ArrayBuffer::kInternalFieldCount * kPointerSize;
9689 9717
9690 private: 9718 private:
9691 // Bit position in a flag 9719 // Bit position in a flag
9692 static const int kIsExternalBit = 0; 9720 static const int kIsExternalBit = 0;
9721 static const int kShouldBeFreed = 1;
9693 9722
9694 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer); 9723 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArrayBuffer);
9695 }; 9724 };
9696 9725
9697 9726
9698 class JSArrayBufferView: public JSObject { 9727 class JSArrayBufferView: public JSObject {
9699 public: 9728 public:
9700 // [buffer]: ArrayBuffer that this typed array views. 9729 // [buffer]: ArrayBuffer that this typed array views.
9701 DECL_ACCESSORS(buffer, Object) 9730 DECL_ACCESSORS(buffer, Object)
9702 9731
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
10607 } else { 10636 } else {
10608 value &= ~(1 << bit_position); 10637 value &= ~(1 << bit_position);
10609 } 10638 }
10610 return value; 10639 return value;
10611 } 10640 }
10612 }; 10641 };
10613 10642
10614 } } // namespace v8::internal 10643 } } // namespace v8::internal
10615 10644
10616 #endif // V8_OBJECTS_H_ 10645 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mksnapshot.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698