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

Side by Side Diff: src/objects.h

Issue 10656018: Separate stub types from property types. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also moving all other bits to the left Created 8 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/stub-cache-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 4181 matching lines...) Expand 10 before | Expand all | Expand 10 after
4192 TO_BOOLEAN_IC, 4192 TO_BOOLEAN_IC,
4193 // No more than 16 kinds. The value currently encoded in four bits in 4193 // No more than 16 kinds. The value currently encoded in four bits in
4194 // Flags. 4194 // Flags.
4195 4195
4196 // Pseudo-kinds. 4196 // Pseudo-kinds.
4197 REGEXP = BUILTIN, 4197 REGEXP = BUILTIN,
4198 FIRST_IC_KIND = LOAD_IC, 4198 FIRST_IC_KIND = LOAD_IC,
4199 LAST_IC_KIND = TO_BOOLEAN_IC 4199 LAST_IC_KIND = TO_BOOLEAN_IC
4200 }; 4200 };
4201 4201
4202 // Types of stubs.
4203 enum StubType {
4204 NORMAL,
4205 FIELD,
4206 CONSTANT_FUNCTION,
4207 CALLBACKS,
4208 INTERCEPTOR,
4209 MAP_TRANSITION,
4210 NONEXISTENT
4211 };
4212
4202 enum { 4213 enum {
4203 NUMBER_OF_KINDS = LAST_IC_KIND + 1 4214 NUMBER_OF_KINDS = LAST_IC_KIND + 1
4204 }; 4215 };
4205 4216
4206 typedef int ExtraICState; 4217 typedef int ExtraICState;
4207 4218
4208 static const ExtraICState kNoExtraICState = 0; 4219 static const ExtraICState kNoExtraICState = 0;
4209 4220
4210 #ifdef ENABLE_DISASSEMBLER 4221 #ifdef ENABLE_DISASSEMBLER
4211 // Printing 4222 // Printing
4212 static const char* Kind2String(Kind kind); 4223 static const char* Kind2String(Kind kind);
4213 static const char* ICState2String(InlineCacheState state); 4224 static const char* ICState2String(InlineCacheState state);
4214 static const char* PropertyType2String(PropertyType type); 4225 static const char* StubType2String(StubType type);
4215 static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra); 4226 static void PrintExtraICState(FILE* out, Kind kind, ExtraICState extra);
4216 inline void Disassemble(const char* name) { 4227 inline void Disassemble(const char* name) {
4217 Disassemble(name, stdout); 4228 Disassemble(name, stdout);
4218 } 4229 }
4219 void Disassemble(const char* name, FILE* out); 4230 void Disassemble(const char* name, FILE* out);
4220 #endif // ENABLE_DISASSEMBLER 4231 #endif // ENABLE_DISASSEMBLER
4221 4232
4222 // [instruction_size]: Size of the native instructions 4233 // [instruction_size]: Size of the native instructions
4223 inline int instruction_size(); 4234 inline int instruction_size();
4224 inline void set_instruction_size(int value); 4235 inline void set_instruction_size(int value);
(...skipping 29 matching lines...) Expand all
4254 inline int relocation_size(); 4265 inline int relocation_size();
4255 4266
4256 // [flags]: Various code flags. 4267 // [flags]: Various code flags.
4257 inline Flags flags(); 4268 inline Flags flags();
4258 inline void set_flags(Flags flags); 4269 inline void set_flags(Flags flags);
4259 4270
4260 // [flags]: Access to specific code flags. 4271 // [flags]: Access to specific code flags.
4261 inline Kind kind(); 4272 inline Kind kind();
4262 inline InlineCacheState ic_state(); // Only valid for IC stubs. 4273 inline InlineCacheState ic_state(); // Only valid for IC stubs.
4263 inline ExtraICState extra_ic_state(); // Only valid for IC stubs. 4274 inline ExtraICState extra_ic_state(); // Only valid for IC stubs.
4264 inline PropertyType type(); // Only valid for monomorphic IC stubs. 4275 inline StubType type(); // Only valid for monomorphic IC stubs.
4265 inline int arguments_count(); // Only valid for call IC stubs. 4276 inline int arguments_count(); // Only valid for call IC stubs.
4266 4277
4267 // Testers for IC stub kinds. 4278 // Testers for IC stub kinds.
4268 inline bool is_inline_cache_stub(); 4279 inline bool is_inline_cache_stub();
4269 inline bool is_load_stub() { return kind() == LOAD_IC; } 4280 inline bool is_load_stub() { return kind() == LOAD_IC; }
4270 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } 4281 inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; }
4271 inline bool is_store_stub() { return kind() == STORE_IC; } 4282 inline bool is_store_stub() { return kind() == STORE_IC; }
4272 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; } 4283 inline bool is_keyed_store_stub() { return kind() == KEYED_STORE_IC; }
4273 inline bool is_call_stub() { return kind() == CALL_IC; } 4284 inline bool is_call_stub() { return kind() == CALL_IC; }
4274 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; } 4285 inline bool is_keyed_call_stub() { return kind() == KEYED_CALL_IC; }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
4397 StrictModeFlag strict_mode) { 4408 StrictModeFlag strict_mode) {
4398 return ExtraICStateKeyedAccessGrowMode::encode(grow_mode) | 4409 return ExtraICStateKeyedAccessGrowMode::encode(grow_mode) |
4399 ExtraICStateStrictMode::encode(strict_mode); 4410 ExtraICStateStrictMode::encode(strict_mode);
4400 } 4411 }
4401 4412
4402 // Flags operations. 4413 // Flags operations.
4403 static inline Flags ComputeFlags( 4414 static inline Flags ComputeFlags(
4404 Kind kind, 4415 Kind kind,
4405 InlineCacheState ic_state = UNINITIALIZED, 4416 InlineCacheState ic_state = UNINITIALIZED,
4406 ExtraICState extra_ic_state = kNoExtraICState, 4417 ExtraICState extra_ic_state = kNoExtraICState,
4407 PropertyType type = NORMAL, 4418 StubType type = NORMAL,
4408 int argc = -1, 4419 int argc = -1,
4409 InlineCacheHolderFlag holder = OWN_MAP); 4420 InlineCacheHolderFlag holder = OWN_MAP);
4410 4421
4411 static inline Flags ComputeMonomorphicFlags( 4422 static inline Flags ComputeMonomorphicFlags(
4412 Kind kind, 4423 Kind kind,
4413 PropertyType type, 4424 StubType type,
4414 ExtraICState extra_ic_state = kNoExtraICState, 4425 ExtraICState extra_ic_state = kNoExtraICState,
4415 InlineCacheHolderFlag holder = OWN_MAP, 4426 InlineCacheHolderFlag holder = OWN_MAP,
4416 int argc = -1); 4427 int argc = -1);
4417 4428
4418 static inline InlineCacheState ExtractICStateFromFlags(Flags flags); 4429 static inline InlineCacheState ExtractICStateFromFlags(Flags flags);
4419 static inline PropertyType ExtractTypeFromFlags(Flags flags); 4430 static inline StubType ExtractTypeFromFlags(Flags flags);
4420 static inline Kind ExtractKindFromFlags(Flags flags); 4431 static inline Kind ExtractKindFromFlags(Flags flags);
4421 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags); 4432 static inline InlineCacheHolderFlag ExtractCacheHolderFromFlags(Flags flags);
4422 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags); 4433 static inline ExtraICState ExtractExtraICStateFromFlags(Flags flags);
4423 static inline int ExtractArgumentsCountFromFlags(Flags flags); 4434 static inline int ExtractArgumentsCountFromFlags(Flags flags);
4424 4435
4425 static inline Flags RemoveTypeFromFlags(Flags flags); 4436 static inline Flags RemoveTypeFromFlags(Flags flags);
4426 4437
4427 // Convert a target address into a code object. 4438 // Convert a target address into a code object.
4428 static inline Code* GetCodeFromTargetAddress(Address address); 4439 static inline Code* GetCodeFromTargetAddress(Address address);
4429 4440
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
4545 static const int kCompareOperationOffset = kCompareStateOffset + 1; 4556 static const int kCompareOperationOffset = kCompareStateOffset + 1;
4546 4557
4547 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1; 4558 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1;
4548 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1; 4559 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1;
4549 4560
4550 static const int kSafepointTableOffsetOffset = kStackSlotsOffset + kIntSize; 4561 static const int kSafepointTableOffsetOffset = kStackSlotsOffset + kIntSize;
4551 static const int kStackCheckTableOffsetOffset = kStackSlotsOffset + kIntSize; 4562 static const int kStackCheckTableOffsetOffset = kStackSlotsOffset + kIntSize;
4552 4563
4553 // Flags layout. BitField<type, shift, size>. 4564 // Flags layout. BitField<type, shift, size>.
4554 class ICStateField: public BitField<InlineCacheState, 0, 3> {}; 4565 class ICStateField: public BitField<InlineCacheState, 0, 3> {};
4555 class TypeField: public BitField<PropertyType, 3, 4> {}; 4566 class TypeField: public BitField<StubType, 3, 3> {};
4556 class CacheHolderField: public BitField<InlineCacheHolderFlag, 7, 1> {}; 4567 class CacheHolderField: public BitField<InlineCacheHolderFlag, 6, 1> {};
4557 class KindField: public BitField<Kind, 8, 4> {}; 4568 class KindField: public BitField<Kind, 7, 4> {};
4558 class ExtraICStateField: public BitField<ExtraICState, 12, 2> {}; 4569 class ExtraICStateField: public BitField<ExtraICState, 11, 2> {};
4559 class IsPregeneratedField: public BitField<bool, 14, 1> {}; 4570 class IsPregeneratedField: public BitField<bool, 13, 1> {};
4560 4571
4561 // Signed field cannot be encoded using the BitField class. 4572 // Signed field cannot be encoded using the BitField class.
4562 static const int kArgumentsCountShift = 15; 4573 static const int kArgumentsCountShift = 14;
4563 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1); 4574 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1);
4564 4575
4565 // This constant should be encodable in an ARM instruction. 4576 // This constant should be encodable in an ARM instruction.
4566 static const int kFlagsNotUsedInLookup = 4577 static const int kFlagsNotUsedInLookup =
4567 TypeField::kMask | CacheHolderField::kMask; 4578 TypeField::kMask | CacheHolderField::kMask;
4568 4579
4569 private: 4580 private:
4570 DISALLOW_IMPLICIT_CONSTRUCTORS(Code); 4581 DISALLOW_IMPLICIT_CONSTRUCTORS(Code);
4571 }; 4582 };
4572 4583
(...skipping 4220 matching lines...) Expand 10 before | Expand all | Expand 10 after
8793 } else { 8804 } else {
8794 value &= ~(1 << bit_position); 8805 value &= ~(1 << bit_position);
8795 } 8806 }
8796 return value; 8807 return value;
8797 } 8808 }
8798 }; 8809 };
8799 8810
8800 } } // namespace v8::internal 8811 } } // namespace v8::internal
8801 8812
8802 #endif // V8_OBJECTS_H_ 8813 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mips/stub-cache-mips.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698