| OLD | NEW |
| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 IC::UtilityId id() const { return id_; } | 189 IC::UtilityId id() const { return id_; } |
| 190 private: | 190 private: |
| 191 Address address_; | 191 Address address_; |
| 192 IC::UtilityId id_; | 192 IC::UtilityId id_; |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 | 195 |
| 196 class CallICBase: public IC { | 196 class CallICBase: public IC { |
| 197 public: | 197 public: |
| 198 class Contextual: public BitField<bool, 0, 1> {}; | 198 class Contextual: public BitField<bool, 0, 1> {}; |
| 199 class StringStubState: public BitField<StringStubFeedback, 1, 1> {}; | 199 class ConstructCall: public BitField<bool, 1, 1> {}; |
| 200 class StringStubState: public BitField<StringStubFeedback, 2, 1> {}; |
| 200 | 201 |
| 201 // Returns a JSFunction or a Failure. | 202 // Returns a JSFunction or a Failure. |
| 202 MUST_USE_RESULT MaybeObject* LoadFunction(State state, | 203 MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
| 203 Code::ExtraICState extra_ic_state, | 204 Code::ExtraICState extra_ic_state, |
| 204 Handle<Object> object, | 205 Handle<Object> object, |
| 205 Handle<String> name); | 206 Handle<String> name); |
| 206 | 207 |
| 207 protected: | 208 protected: |
| 208 CallICBase(Code::Kind kind, Isolate* isolate) | 209 CallICBase(Code::Kind kind, Isolate* isolate) |
| 209 : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} | 210 : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} |
| (...skipping 26 matching lines...) Expand all Loading... |
| 236 | 237 |
| 237 static void Clear(Address address, Code* target); | 238 static void Clear(Address address, Code* target); |
| 238 | 239 |
| 239 // Platform-specific code generation functions used by both call and | 240 // Platform-specific code generation functions used by both call and |
| 240 // keyed call. | 241 // keyed call. |
| 241 static void GenerateMiss(MacroAssembler* masm, | 242 static void GenerateMiss(MacroAssembler* masm, |
| 242 int argc, | 243 int argc, |
| 243 IC::UtilityId id, | 244 IC::UtilityId id, |
| 244 Code::ExtraICState extra_state); | 245 Code::ExtraICState extra_state); |
| 245 | 246 |
| 246 static void GenerateNormal(MacroAssembler* masm, int argc); | 247 static void GenerateNormal(MacroAssembler* masm, |
| 248 int argc, |
| 249 Code::ExtraICState extra_state); |
| 247 | 250 |
| 248 static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, | 251 static void GenerateMonomorphicCacheProbe(MacroAssembler* masm, |
| 249 int argc, | 252 int argc, |
| 250 Code::Kind kind, | 253 Code::Kind kind, |
| 251 Code::ExtraICState extra_state); | 254 Code::ExtraICState extra_state); |
| 252 | 255 |
| 253 Code::Kind kind_; | 256 Code::Kind kind_; |
| 254 | 257 |
| 255 friend class IC; | 258 friend class IC; |
| 256 }; | 259 }; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 272 static void GenerateMiss(MacroAssembler* masm, | 275 static void GenerateMiss(MacroAssembler* masm, |
| 273 int argc, | 276 int argc, |
| 274 Code::ExtraICState extra_state) { | 277 Code::ExtraICState extra_state) { |
| 275 CallICBase::GenerateMiss(masm, argc, IC::kCallIC_Miss, extra_state); | 278 CallICBase::GenerateMiss(masm, argc, IC::kCallIC_Miss, extra_state); |
| 276 } | 279 } |
| 277 | 280 |
| 278 static void GenerateMegamorphic(MacroAssembler* masm, | 281 static void GenerateMegamorphic(MacroAssembler* masm, |
| 279 int argc, | 282 int argc, |
| 280 Code::ExtraICState extra_ic_state); | 283 Code::ExtraICState extra_ic_state); |
| 281 | 284 |
| 282 static void GenerateNormal(MacroAssembler* masm, int argc) { | 285 static void GenerateNormal(MacroAssembler* masm, |
| 283 CallICBase::GenerateNormal(masm, argc); | 286 int argc, |
| 284 GenerateMiss(masm, argc, Code::kNoExtraICState); | 287 Code::ExtraICState extra_state) { |
| 288 CallICBase::GenerateNormal(masm, argc, extra_state); |
| 289 GenerateMiss(masm, argc, extra_state); |
| 285 } | 290 } |
| 286 }; | 291 }; |
| 287 | 292 |
| 288 | 293 |
| 289 class KeyedCallIC: public CallICBase { | 294 class KeyedCallIC: public CallICBase { |
| 290 public: | 295 public: |
| 291 explicit KeyedCallIC(Isolate* isolate) | 296 explicit KeyedCallIC(Isolate* isolate) |
| 292 : CallICBase(Code::KEYED_CALL_IC, isolate) { | 297 : CallICBase(Code::KEYED_CALL_IC, isolate) { |
| 293 ASSERT(target()->is_keyed_call_stub()); | 298 ASSERT(target()->is_keyed_call_stub()); |
| 294 } | 299 } |
| 295 | 300 |
| 296 MUST_USE_RESULT MaybeObject* LoadFunction(State state, | 301 MUST_USE_RESULT MaybeObject* LoadFunction(State state, |
| 302 Code::ExtraICState extra_ic_state, |
| 297 Handle<Object> object, | 303 Handle<Object> object, |
| 298 Handle<Object> key); | 304 Handle<Object> key); |
| 299 | 305 |
| 300 // Code generator routines. | 306 // Code generator routines. |
| 301 static void GenerateInitialize(MacroAssembler* masm, int argc) { | 307 static void GenerateInitialize(MacroAssembler* masm, |
| 302 GenerateMiss(masm, argc); | 308 int argc, |
| 309 Code::ExtraICState extra_state) { |
| 310 GenerateMiss(masm, argc, extra_state); |
| 303 } | 311 } |
| 304 | 312 |
| 305 static void GenerateMiss(MacroAssembler* masm, int argc) { | 313 static void GenerateMiss(MacroAssembler* masm, |
| 306 CallICBase::GenerateMiss(masm, argc, IC::kKeyedCallIC_Miss, | 314 int argc, |
| 307 Code::kNoExtraICState); | 315 Code::ExtraICState extra_state) { |
| 316 CallICBase::GenerateMiss(masm, argc, IC::kKeyedCallIC_Miss, extra_state); |
| 308 } | 317 } |
| 309 | 318 |
| 310 static void GenerateMegamorphic(MacroAssembler* masm, int argc); | 319 static void GenerateMegamorphic(MacroAssembler* masm, |
| 311 static void GenerateNormal(MacroAssembler* masm, int argc); | 320 int argc, |
| 312 static void GenerateNonStrictArguments(MacroAssembler* masm, int argc); | 321 Code::ExtraICState extra_state); |
| 322 |
| 323 static void GenerateNormal(MacroAssembler* masm, |
| 324 int argc, |
| 325 Code::ExtraICState extra_state); |
| 326 |
| 327 static void GenerateNonStrictArguments(MacroAssembler* masm, |
| 328 int argc, |
| 329 Code::ExtraICState extra_state); |
| 313 }; | 330 }; |
| 314 | 331 |
| 315 | 332 |
| 316 class LoadIC: public IC { | 333 class LoadIC: public IC { |
| 317 public: | 334 public: |
| 318 explicit LoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { | 335 explicit LoadIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { |
| 319 ASSERT(target()->is_load_stub()); | 336 ASSERT(target()->is_load_stub()); |
| 320 } | 337 } |
| 321 | 338 |
| 322 MUST_USE_RESULT MaybeObject* Load(State state, | 339 MUST_USE_RESULT MaybeObject* Load(State state, |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 void patch(Code* code); | 766 void patch(Code* code); |
| 750 }; | 767 }; |
| 751 | 768 |
| 752 | 769 |
| 753 // Helper for BinaryOpIC and CompareIC. | 770 // Helper for BinaryOpIC and CompareIC. |
| 754 void PatchInlinedSmiCode(Address address); | 771 void PatchInlinedSmiCode(Address address); |
| 755 | 772 |
| 756 } } // namespace v8::internal | 773 } } // namespace v8::internal |
| 757 | 774 |
| 758 #endif // V8_IC_H_ | 775 #endif // V8_IC_H_ |
| OLD | NEW |