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

Side by Side Diff: src/objects.h

Issue 12225099: Remove prototype checks for leaf maps in optimized code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
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 4688 matching lines...) Expand 10 before | Expand all | Expand 10 after
4699 // All code indexes used in the class are counted starting from the first 4699 // All code indexes used in the class are counted starting from the first
4700 // code object of the first group. In other words, code index 0 corresponds 4700 // code object of the first group. In other words, code index 0 corresponds
4701 // to array index n = kCodesStartIndex. 4701 // to array index n = kCodesStartIndex.
4702 4702
4703 class DependentCodes: public FixedArray { 4703 class DependentCodes: public FixedArray {
4704 public: 4704 public:
4705 enum DependencyGroup { 4705 enum DependencyGroup {
4706 // Group of codes that weakly embed this map and depend on being 4706 // Group of codes that weakly embed this map and depend on being
4707 // deoptimized when the map is garbage collected. 4707 // deoptimized when the map is garbage collected.
4708 kWeaklyEmbeddedGroup, 4708 kWeaklyEmbeddedGroup,
4709 kGroupCount = kWeaklyEmbeddedGroup + 1 4709 // Group of codes that omitted prototype check for a prototype with this map
4710 // and depend on being deoptimized when map layout changes.
4711 kPrototypeCheckGroup,
4712 kGroupCount = kPrototypeCheckGroup + 1
4710 }; 4713 };
4711 // Array for holding the index of the first code object of each group. 4714 // Array for holding the index of the first code object of each group.
4712 // The last element stores the total number of code objects. 4715 // The last element stores the total number of code objects.
4713 typedef int GroupStartIndexes[kGroupCount + 1]; 4716 typedef int GroupStartIndexes[kGroupCount + 1];
4714 inline int number_of_codes(DependencyGroup group); 4717 inline int number_of_codes(DependencyGroup group);
4715 inline void set_number_of_codes(DependencyGroup group, int value); 4718 inline void set_number_of_codes(DependencyGroup group, int value);
4716 inline Code* code_at(int i); 4719 inline Code* code_at(int i);
4717 inline void set_code_at(int i, Code* value); 4720 inline void set_code_at(int i, Code* value);
4718 inline Object** code_slot_at(int i); 4721 inline Object** code_slot_at(int i);
4719 inline void clear_code_at(int i); 4722 inline void clear_code_at(int i);
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
5175 5178
5176 bool CanTransition() { 5179 bool CanTransition() {
5177 // Only JSObject and subtypes have map transitions and back pointers. 5180 // Only JSObject and subtypes have map transitions and back pointers.
5178 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); 5181 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE);
5179 return instance_type() >= FIRST_JS_OBJECT_TYPE; 5182 return instance_type() >= FIRST_JS_OBJECT_TYPE;
5180 } 5183 }
5181 5184
5182 inline void AddDependentCode(DependentCodes::DependencyGroup group, 5185 inline void AddDependentCode(DependentCodes::DependencyGroup group,
5183 Handle<Code> code); 5186 Handle<Code> code);
5184 5187
5188 void DeoptimizeDependentCodes(DependentCodes::DependencyGroup group);
5189
5185 // Dispatched behavior. 5190 // Dispatched behavior.
5186 DECLARE_PRINTER(Map) 5191 DECLARE_PRINTER(Map)
5187 DECLARE_VERIFIER(Map) 5192 DECLARE_VERIFIER(Map)
5188 5193
5189 #ifdef VERIFY_HEAP 5194 #ifdef VERIFY_HEAP
5190 void SharedMapVerify(); 5195 void SharedMapVerify();
5191 #endif 5196 #endif
5192 5197
5193 inline int visitor_id(); 5198 inline int visitor_id();
5194 inline void set_visitor_id(int visitor_id); 5199 inline void set_visitor_id(int visitor_id);
(...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after
8914 } else { 8919 } else {
8915 value &= ~(1 << bit_position); 8920 value &= ~(1 << bit_position);
8916 } 8921 }
8917 return value; 8922 return value;
8918 } 8923 }
8919 }; 8924 };
8920 8925
8921 } } // namespace v8::internal 8926 } } // namespace v8::internal
8922 8927
8923 #endif // V8_OBJECTS_H_ 8928 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698