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

Side by Side Diff: src/objects-inl.h

Issue 163463002: Pass in the handler kind to IC computation rather than extracting it from the handler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
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/objects.h ('k') | src/stub-cache.h » ('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 4186 matching lines...) Expand 10 before | Expand all | Expand 10 after
4197 ASSERT(is_inline_cache_stub() || ic_state() == DEBUG_STUB); 4197 ASSERT(is_inline_cache_stub() || ic_state() == DEBUG_STUB);
4198 return ExtractExtraICStateFromFlags(flags()); 4198 return ExtractExtraICStateFromFlags(flags());
4199 } 4199 }
4200 4200
4201 4201
4202 Code::StubType Code::type() { 4202 Code::StubType Code::type() {
4203 return ExtractTypeFromFlags(flags()); 4203 return ExtractTypeFromFlags(flags());
4204 } 4204 }
4205 4205
4206 4206
4207 int Code::arguments_count() {
4208 ASSERT(kind() == STUB || is_handler());
4209 return ExtractArgumentsCountFromFlags(flags());
4210 }
4211
4212
4213 // For initialization. 4207 // For initialization.
4214 void Code::set_raw_kind_specific_flags1(int value) { 4208 void Code::set_raw_kind_specific_flags1(int value) {
4215 WRITE_INT_FIELD(this, kKindSpecificFlags1Offset, value); 4209 WRITE_INT_FIELD(this, kKindSpecificFlags1Offset, value);
4216 } 4210 }
4217 4211
4218 4212
4219 void Code::set_raw_kind_specific_flags2(int value) { 4213 void Code::set_raw_kind_specific_flags2(int value) {
4220 WRITE_INT_FIELD(this, kKindSpecificFlags2Offset, value); 4214 WRITE_INT_FIELD(this, kKindSpecificFlags2Offset, value);
4221 } 4215 }
4222 4216
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
4485 ExtraICState extra_ic_state, 4479 ExtraICState extra_ic_state,
4486 StubType type, 4480 StubType type,
4487 Kind handler_kind, 4481 Kind handler_kind,
4488 InlineCacheHolderFlag holder) { 4482 InlineCacheHolderFlag holder) {
4489 // Compute the bit mask. 4483 // Compute the bit mask.
4490 unsigned int bits = KindField::encode(kind) 4484 unsigned int bits = KindField::encode(kind)
4491 | ICStateField::encode(ic_state) 4485 | ICStateField::encode(ic_state)
4492 | TypeField::encode(type) 4486 | TypeField::encode(type)
4493 | ExtraICStateField::encode(extra_ic_state) 4487 | ExtraICStateField::encode(extra_ic_state)
4494 | CacheHolderField::encode(holder); 4488 | CacheHolderField::encode(holder);
4489 // TODO(verwaest): Move to the valid uses of |handler_kind|.
4495 if (handler_kind != STUB) { 4490 if (handler_kind != STUB) {
4496 bits |= (handler_kind << kArgumentsCountShift); 4491 bits |= HandlerKindField::encode(handler_kind);
4497 } 4492 }
4498 return static_cast<Flags>(bits); 4493 return static_cast<Flags>(bits);
4499 } 4494 }
4500 4495
4501 4496
4502 Code::Flags Code::ComputeMonomorphicFlags(Kind kind, 4497 Code::Flags Code::ComputeMonomorphicFlags(Kind kind,
4503 ExtraICState extra_ic_state, 4498 ExtraICState extra_ic_state,
4504 InlineCacheHolderFlag holder, 4499 InlineCacheHolderFlag holder,
4505 StubType type, 4500 StubType type,
4506 Kind handler_kind) { 4501 Kind handler_kind) {
(...skipping 15 matching lines...) Expand all
4522 ExtraICState Code::ExtractExtraICStateFromFlags(Flags flags) { 4517 ExtraICState Code::ExtractExtraICStateFromFlags(Flags flags) {
4523 return ExtraICStateField::decode(flags); 4518 return ExtraICStateField::decode(flags);
4524 } 4519 }
4525 4520
4526 4521
4527 Code::StubType Code::ExtractTypeFromFlags(Flags flags) { 4522 Code::StubType Code::ExtractTypeFromFlags(Flags flags) {
4528 return TypeField::decode(flags); 4523 return TypeField::decode(flags);
4529 } 4524 }
4530 4525
4531 4526
4532 int Code::ExtractArgumentsCountFromFlags(Flags flags) {
4533 return (flags & kArgumentsCountMask) >> kArgumentsCountShift;
4534 }
4535
4536
4537 InlineCacheHolderFlag Code::ExtractCacheHolderFromFlags(Flags flags) { 4527 InlineCacheHolderFlag Code::ExtractCacheHolderFromFlags(Flags flags) {
4538 return CacheHolderField::decode(flags); 4528 return CacheHolderField::decode(flags);
4539 } 4529 }
4540 4530
4541 4531
4542 Code::Flags Code::RemoveTypeFromFlags(Flags flags) { 4532 Code::Flags Code::RemoveTypeFromFlags(Flags flags) {
4543 int bits = flags & ~TypeField::kMask; 4533 int bits = flags & ~TypeField::kMask;
4544 return static_cast<Flags>(bits); 4534 return static_cast<Flags>(bits);
4545 } 4535 }
4546 4536
(...skipping 2197 matching lines...) Expand 10 before | Expand all | Expand 10 after
6744 #undef READ_UINT32_FIELD 6734 #undef READ_UINT32_FIELD
6745 #undef WRITE_UINT32_FIELD 6735 #undef WRITE_UINT32_FIELD
6746 #undef READ_SHORT_FIELD 6736 #undef READ_SHORT_FIELD
6747 #undef WRITE_SHORT_FIELD 6737 #undef WRITE_SHORT_FIELD
6748 #undef READ_BYTE_FIELD 6738 #undef READ_BYTE_FIELD
6749 #undef WRITE_BYTE_FIELD 6739 #undef WRITE_BYTE_FIELD
6750 6740
6751 } } // namespace v8::internal 6741 } } // namespace v8::internal
6752 6742
6753 #endif // V8_OBJECTS_INL_H_ 6743 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698