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

Side by Side Diff: src/objects.h

Issue 17895004: Add DependentCode to PropertyCells (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Moar review feedback Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/lithium-codegen-mips.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 5012 matching lines...) Expand 10 before | Expand all | Expand 10 after
5023 // deoptimized when the transition is replaced by a new version. 5023 // deoptimized when the transition is replaced by a new version.
5024 kTransitionGroup, 5024 kTransitionGroup,
5025 // Group of code that omit run-time prototype checks for prototypes 5025 // Group of code that omit run-time prototype checks for prototypes
5026 // described by this map. The group is deoptimized whenever an object 5026 // described by this map. The group is deoptimized whenever an object
5027 // described by this map changes shape (and transitions to a new map), 5027 // described by this map changes shape (and transitions to a new map),
5028 // possibly invalidating the assumptions embedded in the code. 5028 // possibly invalidating the assumptions embedded in the code.
5029 kPrototypeCheckGroup, 5029 kPrototypeCheckGroup,
5030 // Group of code that depends on elements not being added to objects with 5030 // Group of code that depends on elements not being added to objects with
5031 // this map. 5031 // this map.
5032 kElementsCantBeAddedGroup, 5032 kElementsCantBeAddedGroup,
5033 kGroupCount = kElementsCantBeAddedGroup + 1 5033 // Group of code that depends on global property values in property cells
5034 // not being changed.
5035 kPropertyCellChangedGroup,
5036 kGroupCount = kPropertyCellChangedGroup + 1
5034 }; 5037 };
5035 5038
5036 // Array for holding the index of the first code object of each group. 5039 // Array for holding the index of the first code object of each group.
5037 // The last element stores the total number of code objects. 5040 // The last element stores the total number of code objects.
5038 class GroupStartIndexes { 5041 class GroupStartIndexes {
5039 public: 5042 public:
5040 explicit GroupStartIndexes(DependentCode* entries); 5043 explicit GroupStartIndexes(DependentCode* entries);
5041 void Recompute(DependentCode* entries); 5044 void Recompute(DependentCode* entries);
5042 int at(int i) { return start_indexes_[i]; } 5045 int at(int i) { return start_indexes_[i]; }
5043 int number_of_entries() { return start_indexes_[kGroupCount]; } 5046 int number_of_entries() { return start_indexes_[kGroupCount]; }
(...skipping 21 matching lines...) Expand all
5065 inline bool is_code_at(int i); 5068 inline bool is_code_at(int i);
5066 inline Code* code_at(int i); 5069 inline Code* code_at(int i);
5067 inline CompilationInfo* compilation_info_at(int i); 5070 inline CompilationInfo* compilation_info_at(int i);
5068 inline void set_object_at(int i, Object* object); 5071 inline void set_object_at(int i, Object* object);
5069 inline Object** slot_at(int i); 5072 inline Object** slot_at(int i);
5070 inline Object* object_at(int i); 5073 inline Object* object_at(int i);
5071 inline void clear_at(int i); 5074 inline void clear_at(int i);
5072 inline void copy(int from, int to); 5075 inline void copy(int from, int to);
5073 static inline DependentCode* cast(Object* object); 5076 static inline DependentCode* cast(Object* object);
5074 5077
5078 static DependentCode* ForObject(Handle<HeapObject> object,
5079 DependencyGroup group);
5080
5075 private: 5081 private:
5076 // Make a room at the end of the given group by moving out the first 5082 // Make a room at the end of the given group by moving out the first
5077 // code objects of the subsequent groups. 5083 // code objects of the subsequent groups.
5078 inline void ExtendGroup(DependencyGroup group); 5084 inline void ExtendGroup(DependencyGroup group);
5079 static const int kCodesStartIndex = kGroupCount; 5085 static const int kCodesStartIndex = kGroupCount;
5080 }; 5086 };
5081 5087
5082 5088
5083 // All heap objects have a Map that describes their structure. 5089 // All heap objects have a Map that describes their structure.
5084 // A Map contains information about: 5090 // A Map contains information about:
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
5562 } 5568 }
5563 5569
5564 // Fires when the layout of an object with a leaf map changes. 5570 // Fires when the layout of an object with a leaf map changes.
5565 // This includes adding transitions to the leaf map or changing 5571 // This includes adding transitions to the leaf map or changing
5566 // the descriptor array. 5572 // the descriptor array.
5567 inline void NotifyLeafMapLayoutChange(); 5573 inline void NotifyLeafMapLayoutChange();
5568 5574
5569 inline bool CanOmitPrototypeChecks(); 5575 inline bool CanOmitPrototypeChecks();
5570 5576
5571 void AddDependentCompilationInfo(DependentCode::DependencyGroup group, 5577 void AddDependentCompilationInfo(DependentCode::DependencyGroup group,
5572 CompilationInfo* info); 5578 CompilationInfo* info);
5573 5579
5574 void AddDependentCode(DependentCode::DependencyGroup group, 5580 void AddDependentCode(DependentCode::DependencyGroup group,
5575 Handle<Code> code); 5581 Handle<Code> code);
5576 5582
5577 bool IsMapInArrayPrototypeChain(); 5583 bool IsMapInArrayPrototypeChain();
5578 5584
5579 // Dispatched behavior. 5585 // Dispatched behavior.
5580 DECLARE_PRINTER(Map) 5586 DECLARE_PRINTER(Map)
5581 DECLARE_VERIFIER(Map) 5587 DECLARE_VERIFIER(Map)
5582 5588
(...skipping 2982 matching lines...) Expand 10 before | Expand all | Expand 10 after
8565 kValueOffset + kPointerSize, 8571 kValueOffset + kPointerSize,
8566 kSize> BodyDescriptor; 8572 kSize> BodyDescriptor;
8567 8573
8568 private: 8574 private:
8569 DISALLOW_IMPLICIT_CONSTRUCTORS(Cell); 8575 DISALLOW_IMPLICIT_CONSTRUCTORS(Cell);
8570 }; 8576 };
8571 8577
8572 8578
8573 class PropertyCell: public Cell { 8579 class PropertyCell: public Cell {
8574 public: 8580 public:
8581 // [type]: type of the global property.
8575 Type* type(); 8582 Type* type();
8576 void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 8583 void set_type(Type* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
8577 8584
8585 // [dependent_code]: dependent code that depends on the type of the global
8586 // property.
8587 DECL_ACCESSORS(dependent_code, DependentCode)
8588
8578 // Casting. 8589 // Casting.
8579 static inline PropertyCell* cast(Object* obj); 8590 static inline PropertyCell* cast(Object* obj);
8580 8591
8581 inline Address TypeAddress() { 8592 inline Address TypeAddress() {
8582 return address() + kTypeOffset; 8593 return address() + kTypeOffset;
8583 } 8594 }
8584 8595
8585 // Dispatched behavior. 8596 // Dispatched behavior.
8586 DECLARE_PRINTER(PropertyCell) 8597 DECLARE_PRINTER(PropertyCell)
8587 DECLARE_VERIFIER(PropertyCell) 8598 DECLARE_VERIFIER(PropertyCell)
8588 8599
8589 // Layout description. 8600 // Layout description.
8590 static const int kTypeOffset = kValueOffset + kPointerSize; 8601 static const int kTypeOffset = kValueOffset + kPointerSize;
8591 static const int kSize = kTypeOffset + kPointerSize; 8602 static const int kDependentCodeOffset = kTypeOffset + kPointerSize;
8603 static const int kSize = kDependentCodeOffset + kPointerSize;
8592 8604
8593 typedef FixedBodyDescriptor< 8605 static const int kPointerFieldsBeginOffset = kValueOffset;
8594 kValueOffset, 8606 static const int kPointerFieldsEndOffset = kDependentCodeOffset;
8595 kTypeOffset + kPointerSize, 8607
8596 PropertyCell::kSize> BodyDescriptor; 8608 typedef FixedBodyDescriptor<kValueOffset,
8609 kSize,
8610 kSize> BodyDescriptor;
8611
8612 void AddDependentCompilationInfo(CompilationInfo* info);
8613
8614 void AddDependentCode(Handle<Code> code);
8597 8615
8598 private: 8616 private:
8599 DECL_ACCESSORS(type_raw, Object) 8617 DECL_ACCESSORS(type_raw, Object)
8600 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); 8618 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell);
8601 }; 8619 };
8602 8620
8603 8621
8604 // The JSProxy describes EcmaScript Harmony proxies 8622 // The JSProxy describes EcmaScript Harmony proxies
8605 class JSProxy: public JSReceiver { 8623 class JSProxy: public JSReceiver {
8606 public: 8624 public:
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
9728 } else { 9746 } else {
9729 value &= ~(1 << bit_position); 9747 value &= ~(1 << bit_position);
9730 } 9748 }
9731 return value; 9749 return value;
9732 } 9750 }
9733 }; 9751 };
9734 9752
9735 } } // namespace v8::internal 9753 } } // namespace v8::internal
9736 9754
9737 #endif // V8_OBJECTS_H_ 9755 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/lithium-codegen-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698