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

Side by Side Diff: src/code-stubs.h

Issue 140943002: Fix logic error in assert in IsUndeclaredGlobal() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Ports and addressed comments. Created 6 years, 11 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/arm/lithium-codegen-arm.cc ('k') | src/disassembler.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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 virtual Handle<Code> GenerateCode(Isolate* isolate); 1051 virtual Handle<Code> GenerateCode(Isolate* isolate);
1052 1052
1053 private: 1053 private:
1054 virtual CodeStub::Major MajorKey() { return KeyedLoadField; } 1054 virtual CodeStub::Major MajorKey() { return KeyedLoadField; }
1055 }; 1055 };
1056 1056
1057 1057
1058 class KeyedArrayCallStub: public HICStub { 1058 class KeyedArrayCallStub: public HICStub {
1059 public: 1059 public:
1060 KeyedArrayCallStub(bool holey, int argc) : HICStub(), argc_(argc) { 1060 KeyedArrayCallStub(bool holey, int argc) : HICStub(), argc_(argc) {
1061 bit_field_ = ContextualBits::encode(false) | HoleyBits::encode(holey); 1061 bit_field_ = HoleyBits::encode(holey);
1062 } 1062 }
1063 1063
1064 virtual Code::Kind kind() const { return Code::KEYED_CALL_IC; } 1064 virtual Code::Kind kind() const { return Code::KEYED_CALL_IC; }
1065 virtual ExtraICState GetExtraICState() { return bit_field_; } 1065 virtual ExtraICState GetExtraICState() { return bit_field_; }
1066 1066
1067 ElementsKind elements_kind() { 1067 ElementsKind elements_kind() {
1068 return HoleyBits::decode(bit_field_) ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS; 1068 return HoleyBits::decode(bit_field_) ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS;
1069 } 1069 }
1070 1070
1071 int argc() { return argc_; } 1071 int argc() { return argc_; }
1072 virtual int GetStubFlags() { return argc(); } 1072 virtual int GetStubFlags() { return argc(); }
1073 1073
1074 static bool IsHoley(Handle<Code> code) { 1074 static bool IsHoley(Handle<Code> code) {
1075 ExtraICState state = code->extra_ic_state(); 1075 ExtraICState state = code->extra_ic_state();
1076 return HoleyBits::decode(state); 1076 return HoleyBits::decode(state);
1077 } 1077 }
1078 1078
1079 virtual void InitializeInterfaceDescriptor( 1079 virtual void InitializeInterfaceDescriptor(
1080 Isolate* isolate, 1080 Isolate* isolate,
1081 CodeStubInterfaceDescriptor* descriptor); 1081 CodeStubInterfaceDescriptor* descriptor);
1082 1082
1083 virtual Handle<Code> GenerateCode(Isolate* isolate); 1083 virtual Handle<Code> GenerateCode(Isolate* isolate);
1084 1084
1085 private: 1085 private:
1086 virtual int NotMissMinorKey() { 1086 virtual int NotMissMinorKey() {
1087 return GetExtraICState() | ArgcBits::encode(argc_); 1087 return GetExtraICState() | ArgcBits::encode(argc_);
1088 } 1088 }
1089 1089
1090 class ContextualBits: public BitField<bool, 0, 1> {}; 1090 // We have to start storing extra ic bits at 1, because calls use bit zero
1091 STATIC_ASSERT(IC::Contextual::kShift == ContextualBits::kShift); 1091 // for string stub state.
1092 STATIC_ASSERT(IC::Contextual::kSize == ContextualBits::kSize); 1092 STATIC_ASSERT(CallICBase::StringStubState::kShift == 0);
1093 STATIC_ASSERT(CallICBase::StringStubState::kSize == 1);
1093 class HoleyBits: public BitField<bool, 1, 1> {}; 1094 class HoleyBits: public BitField<bool, 1, 1> {};
1094 STATIC_ASSERT(Code::kArgumentsBits <= kStubMinorKeyBits - 2); 1095 STATIC_ASSERT(Code::kArgumentsBits <= kStubMinorKeyBits - 2);
1095 class ArgcBits: public BitField<int, 2, Code::kArgumentsBits> {}; 1096 class ArgcBits: public BitField<int, 2, Code::kArgumentsBits> {};
1096 virtual CodeStub::Major MajorKey() { return KeyedArrayCall; } 1097 virtual CodeStub::Major MajorKey() { return KeyedArrayCall; }
1097 int bit_field_; 1098 int bit_field_;
1098 int argc_; 1099 int argc_;
1099 }; 1100 };
1100 1101
1101 1102
1102 class BinaryOpICStub : public HydrogenCodeStub { 1103 class BinaryOpICStub : public HydrogenCodeStub {
(...skipping 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
2469 2470
2470 2471
2471 class CallDescriptors { 2472 class CallDescriptors {
2472 public: 2473 public:
2473 static void InitializeForIsolate(Isolate* isolate); 2474 static void InitializeForIsolate(Isolate* isolate);
2474 }; 2475 };
2475 2476
2476 } } // namespace v8::internal 2477 } } // namespace v8::internal
2477 2478
2478 #endif // V8_CODE_STUBS_H_ 2479 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | src/disassembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698