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

Side by Side Diff: src/objects.h

Issue 9310117: Implement KeyedStoreICs to grow arrays on out-of-bound stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing WB stub Created 8 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/ic-inl.h ('k') | src/objects-debug.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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS, 161 LAST_EXTERNAL_ARRAY_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS,
162 FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS, 162 FIRST_ELEMENTS_KIND = FAST_SMI_ONLY_ELEMENTS,
163 LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS 163 LAST_ELEMENTS_KIND = EXTERNAL_PIXEL_ELEMENTS
164 }; 164 };
165 165
166 enum CompareMapMode { 166 enum CompareMapMode {
167 REQUIRE_EXACT_MAP, 167 REQUIRE_EXACT_MAP,
168 ALLOW_ELEMENT_TRANSITION_MAPS 168 ALLOW_ELEMENT_TRANSITION_MAPS
169 }; 169 };
170 170
171 enum KeyedAccessGrowMode {
172 DO_NOT_ALLOW_JSARRAY_GROWTH,
173 ALLOW_JSARRAY_GROWTH
174 };
175
171 const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1; 176 const int kElementsKindCount = LAST_ELEMENTS_KIND - FIRST_ELEMENTS_KIND + 1;
172 177
173 void PrintElementsKind(FILE* out, ElementsKind kind); 178 void PrintElementsKind(FILE* out, ElementsKind kind);
174 179
175 inline bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind, 180 inline bool IsMoreGeneralElementsKindTransition(ElementsKind from_kind,
176 ElementsKind to_kind); 181 ElementsKind to_kind);
177 182
178 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER. 183 // Setter that skips the write barrier if mode is SKIP_WRITE_BARRIER.
179 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER }; 184 enum WriteBarrierMode { SKIP_WRITE_BARRIER, UPDATE_WRITE_BARRIER };
180 185
(...skipping 4028 matching lines...) Expand 10 before | Expand all | Expand 10 after
4209 // Get the safepoint entry for the given pc. 4214 // Get the safepoint entry for the given pc.
4210 SafepointEntry GetSafepointEntry(Address pc); 4215 SafepointEntry GetSafepointEntry(Address pc);
4211 4216
4212 // Mark this code object as not having a stack check table. Assumes kind 4217 // Mark this code object as not having a stack check table. Assumes kind
4213 // is FUNCTION. 4218 // is FUNCTION.
4214 void SetNoStackCheckTable(); 4219 void SetNoStackCheckTable();
4215 4220
4216 // Find the first map in an IC stub. 4221 // Find the first map in an IC stub.
4217 Map* FindFirstMap(); 4222 Map* FindFirstMap();
4218 4223
4224 class ExtraICStateStrictMode: public BitField<StrictModeFlag, 0, 1> {};
4225 class ExtraICStateKeyedAccessGrowMode:
4226 public BitField<KeyedAccessGrowMode, 1, 1> {}; // NOLINT
4227
4228 static const int kExtraICStateGrowModeShift = 1;
4229
4230 static inline StrictModeFlag GetStrictMode(ExtraICState extra_ic_state) {
4231 return ExtraICStateStrictMode::decode(extra_ic_state);
4232 }
4233
4234 static inline KeyedAccessGrowMode GetKeyedAccessGrowMode(
4235 ExtraICState extra_ic_state) {
4236 return ExtraICStateKeyedAccessGrowMode::decode(extra_ic_state);
4237 }
4238
4239 static inline ExtraICState ComputeExtraICState(
4240 KeyedAccessGrowMode grow_mode,
4241 StrictModeFlag strict_mode) {
4242 return ExtraICStateKeyedAccessGrowMode::encode(grow_mode) |
4243 ExtraICStateStrictMode::encode(strict_mode);
4244 }
4245
4219 // Flags operations. 4246 // Flags operations.
4220 static inline Flags ComputeFlags( 4247 static inline Flags ComputeFlags(
4221 Kind kind, 4248 Kind kind,
4222 InlineCacheState ic_state = UNINITIALIZED, 4249 InlineCacheState ic_state = UNINITIALIZED,
4223 ExtraICState extra_ic_state = kNoExtraICState, 4250 ExtraICState extra_ic_state = kNoExtraICState,
4224 PropertyType type = NORMAL, 4251 PropertyType type = NORMAL,
4225 int argc = -1, 4252 int argc = -1,
4226 InlineCacheHolderFlag holder = OWN_MAP); 4253 InlineCacheHolderFlag holder = OWN_MAP);
4227 4254
4228 static inline Flags ComputeMonomorphicFlags( 4255 static inline Flags ComputeMonomorphicFlags(
(...skipping 4030 matching lines...) Expand 10 before | Expand all | Expand 10 after
8259 } else { 8286 } else {
8260 value &= ~(1 << bit_position); 8287 value &= ~(1 << bit_position);
8261 } 8288 }
8262 return value; 8289 return value;
8263 } 8290 }
8264 }; 8291 };
8265 8292
8266 } } // namespace v8::internal 8293 } } // namespace v8::internal
8267 8294
8268 #endif // V8_OBJECTS_H_ 8295 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/ic-inl.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698