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

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

Issue 6894003: Better support for 'polymorphic' JS and external arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: final review feedback Created 9 years, 7 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.cc ('k') | src/spaces.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 2577 matching lines...) Expand 10 before | Expand all | Expand 10 after
2588 } 2588 }
2589 2589
2590 2590
2591 Code::ExtraICState Code::extra_ic_state() { 2591 Code::ExtraICState Code::extra_ic_state() {
2592 ASSERT(is_inline_cache_stub()); 2592 ASSERT(is_inline_cache_stub());
2593 return ExtractExtraICStateFromFlags(flags()); 2593 return ExtractExtraICStateFromFlags(flags());
2594 } 2594 }
2595 2595
2596 2596
2597 PropertyType Code::type() { 2597 PropertyType Code::type() {
2598 ASSERT(ic_state() == MONOMORPHIC);
2599 return ExtractTypeFromFlags(flags()); 2598 return ExtractTypeFromFlags(flags());
2600 } 2599 }
2601 2600
2602 2601
2603 int Code::arguments_count() { 2602 int Code::arguments_count() {
2604 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB); 2603 ASSERT(is_call_stub() || is_keyed_call_stub() || kind() == STUB);
2605 return ExtractArgumentsCountFromFlags(flags()); 2604 return ExtractArgumentsCountFromFlags(flags());
2606 } 2605 }
2607 2606
2608 2607
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
2706 } 2705 }
2707 2706
2708 2707
2709 void Code::set_check_type(CheckType value) { 2708 void Code::set_check_type(CheckType value) {
2710 ASSERT(is_call_stub() || is_keyed_call_stub()); 2709 ASSERT(is_call_stub() || is_keyed_call_stub());
2711 WRITE_BYTE_FIELD(this, kCheckTypeOffset, value); 2710 WRITE_BYTE_FIELD(this, kCheckTypeOffset, value);
2712 } 2711 }
2713 2712
2714 2713
2715 ExternalArrayType Code::external_array_type() { 2714 ExternalArrayType Code::external_array_type() {
2716 ASSERT(is_external_array_load_stub() || is_external_array_store_stub()); 2715 ASSERT(is_keyed_load_stub() || is_keyed_store_stub());
2717 byte type = READ_BYTE_FIELD(this, kExternalArrayTypeOffset); 2716 byte type = READ_BYTE_FIELD(this, kExternalArrayTypeOffset);
2718 return static_cast<ExternalArrayType>(type); 2717 return static_cast<ExternalArrayType>(type);
2719 } 2718 }
2720 2719
2721 2720
2722 void Code::set_external_array_type(ExternalArrayType value) { 2721 void Code::set_external_array_type(ExternalArrayType value) {
2723 ASSERT(is_external_array_load_stub() || is_external_array_store_stub()); 2722 ASSERT(is_keyed_load_stub() || is_keyed_store_stub());
2724 WRITE_BYTE_FIELD(this, kExternalArrayTypeOffset, value); 2723 WRITE_BYTE_FIELD(this, kExternalArrayTypeOffset, value);
2725 } 2724 }
2726 2725
2727 2726
2728 byte Code::type_recording_unary_op_type() { 2727 byte Code::type_recording_unary_op_type() {
2729 ASSERT(is_type_recording_unary_op_stub()); 2728 ASSERT(is_type_recording_unary_op_stub());
2730 return READ_BYTE_FIELD(this, kUnaryOpTypeOffset); 2729 return READ_BYTE_FIELD(this, kUnaryOpTypeOffset);
2731 } 2730 }
2732 2731
2733 2732
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2785 ExtraICState extra_ic_state, 2784 ExtraICState extra_ic_state,
2786 PropertyType type, 2785 PropertyType type,
2787 int argc, 2786 int argc,
2788 InlineCacheHolderFlag holder) { 2787 InlineCacheHolderFlag holder) {
2789 // Extra IC state is only allowed for monomorphic call IC stubs 2788 // Extra IC state is only allowed for monomorphic call IC stubs
2790 // or for store IC stubs. 2789 // or for store IC stubs.
2791 ASSERT(extra_ic_state == kNoExtraICState || 2790 ASSERT(extra_ic_state == kNoExtraICState ||
2792 (kind == CALL_IC && (ic_state == MONOMORPHIC || 2791 (kind == CALL_IC && (ic_state == MONOMORPHIC ||
2793 ic_state == MONOMORPHIC_PROTOTYPE_FAILURE)) || 2792 ic_state == MONOMORPHIC_PROTOTYPE_FAILURE)) ||
2794 (kind == STORE_IC) || 2793 (kind == STORE_IC) ||
2795 (kind == KEYED_STORE_IC) || 2794 (kind == KEYED_STORE_IC));
2796 (kind == KEYED_EXTERNAL_ARRAY_STORE_IC));
2797 // Compute the bit mask. 2795 // Compute the bit mask.
2798 int bits = kind << kFlagsKindShift; 2796 int bits = kind << kFlagsKindShift;
2799 if (in_loop) bits |= kFlagsICInLoopMask; 2797 if (in_loop) bits |= kFlagsICInLoopMask;
2800 bits |= ic_state << kFlagsICStateShift; 2798 bits |= ic_state << kFlagsICStateShift;
2801 bits |= type << kFlagsTypeShift; 2799 bits |= type << kFlagsTypeShift;
2802 bits |= extra_ic_state << kFlagsExtraICStateShift; 2800 bits |= extra_ic_state << kFlagsExtraICStateShift;
2803 bits |= argc << kFlagsArgumentsCountShift; 2801 bits |= argc << kFlagsArgumentsCountShift;
2804 if (holder == PROTOTYPE_MAP) bits |= kFlagsCacheInPrototypeMapMask; 2802 if (holder == PROTOTYPE_MAP) bits |= kFlagsCacheInPrototypeMapMask;
2805 // Cast to flags and validate result before returning it. 2803 // Cast to flags and validate result before returning it.
2806 Flags result = static_cast<Flags>(bits); 2804 Flags result = static_cast<Flags>(bits);
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after
4230 #undef WRITE_INT_FIELD 4228 #undef WRITE_INT_FIELD
4231 #undef READ_SHORT_FIELD 4229 #undef READ_SHORT_FIELD
4232 #undef WRITE_SHORT_FIELD 4230 #undef WRITE_SHORT_FIELD
4233 #undef READ_BYTE_FIELD 4231 #undef READ_BYTE_FIELD
4234 #undef WRITE_BYTE_FIELD 4232 #undef WRITE_BYTE_FIELD
4235 4233
4236 4234
4237 } } // namespace v8::internal 4235 } } // namespace v8::internal
4238 4236
4239 #endif // V8_OBJECTS_INL_H_ 4237 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698