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

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

Issue 81043002: Code object now prints its major_key when applicable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Identation fixed. Created 7 years 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') | no next file » | 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 3856 matching lines...) Expand 10 before | Expand all | Expand 10 after
3867 3867
3868 3868
3869 inline void Code::set_is_crankshafted(bool value) { 3869 inline void Code::set_is_crankshafted(bool value) {
3870 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); 3870 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
3871 int updated = IsCrankshaftedField::update(previous, value); 3871 int updated = IsCrankshaftedField::update(previous, value);
3872 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); 3872 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
3873 } 3873 }
3874 3874
3875 3875
3876 int Code::major_key() { 3876 int Code::major_key() {
3877 ASSERT(kind() == STUB || 3877 ASSERT(has_major_key());
3878 kind() == HANDLER ||
3879 kind() == BINARY_OP_IC ||
3880 kind() == COMPARE_IC ||
3881 kind() == COMPARE_NIL_IC ||
3882 kind() == STORE_IC ||
3883 kind() == LOAD_IC ||
3884 kind() == KEYED_LOAD_IC ||
3885 kind() == KEYED_CALL_IC ||
3886 kind() == TO_BOOLEAN_IC);
3887 return StubMajorKeyField::decode( 3878 return StubMajorKeyField::decode(
3888 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset)); 3879 READ_UINT32_FIELD(this, kKindSpecificFlags2Offset));
3889 } 3880 }
3890 3881
3891 3882
3892 void Code::set_major_key(int major) { 3883 void Code::set_major_key(int major) {
3893 ASSERT(kind() == STUB || 3884 ASSERT(has_major_key());
3894 kind() == HANDLER ||
3895 kind() == BINARY_OP_IC ||
3896 kind() == COMPARE_IC ||
3897 kind() == COMPARE_NIL_IC ||
3898 kind() == LOAD_IC ||
3899 kind() == KEYED_LOAD_IC ||
3900 kind() == STORE_IC ||
3901 kind() == KEYED_STORE_IC ||
3902 kind() == KEYED_CALL_IC ||
3903 kind() == TO_BOOLEAN_IC);
3904 ASSERT(0 <= major && major < 256); 3885 ASSERT(0 <= major && major < 256);
3905 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset); 3886 int previous = READ_UINT32_FIELD(this, kKindSpecificFlags2Offset);
3906 int updated = StubMajorKeyField::update(previous, major); 3887 int updated = StubMajorKeyField::update(previous, major);
3907 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated); 3888 WRITE_UINT32_FIELD(this, kKindSpecificFlags2Offset, updated);
3908 } 3889 }
3909 3890
3910 3891
3892 bool Code::has_major_key() {
3893 return kind() == STUB ||
3894 kind() == HANDLER ||
3895 kind() == BINARY_OP_IC ||
3896 kind() == COMPARE_IC ||
3897 kind() == COMPARE_NIL_IC ||
3898 kind() == LOAD_IC ||
3899 kind() == KEYED_LOAD_IC ||
3900 kind() == STORE_IC ||
3901 kind() == KEYED_STORE_IC ||
3902 kind() == KEYED_CALL_IC ||
3903 kind() == TO_BOOLEAN_IC;
3904 }
3905
3906
3911 bool Code::is_pregenerated() { 3907 bool Code::is_pregenerated() {
3912 return (kind() == STUB && IsPregeneratedField::decode(flags())); 3908 return (kind() == STUB && IsPregeneratedField::decode(flags()));
3913 } 3909 }
3914 3910
3915 3911
3916 void Code::set_is_pregenerated(bool value) { 3912 void Code::set_is_pregenerated(bool value) {
3917 ASSERT(kind() == STUB); 3913 ASSERT(kind() == STUB);
3918 Flags f = flags(); 3914 Flags f = flags();
3919 f = static_cast<Flags>(IsPregeneratedField::update(f, value)); 3915 f = static_cast<Flags>(IsPregeneratedField::update(f, value));
3920 set_flags(f); 3916 set_flags(f);
(...skipping 2490 matching lines...) Expand 10 before | Expand all | Expand 10 after
6411 #undef WRITE_UINT32_FIELD 6407 #undef WRITE_UINT32_FIELD
6412 #undef READ_SHORT_FIELD 6408 #undef READ_SHORT_FIELD
6413 #undef WRITE_SHORT_FIELD 6409 #undef WRITE_SHORT_FIELD
6414 #undef READ_BYTE_FIELD 6410 #undef READ_BYTE_FIELD
6415 #undef WRITE_BYTE_FIELD 6411 #undef WRITE_BYTE_FIELD
6416 6412
6417 6413
6418 } } // namespace v8::internal 6414 } } // namespace v8::internal
6419 6415
6420 #endif // V8_OBJECTS_INL_H_ 6416 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698