OLD | NEW |
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 | 276 |
277 Address address() const { return address_; } | 277 Address address() const { return address_; } |
278 | 278 |
279 IC::UtilityId id() const { return id_; } | 279 IC::UtilityId id() const { return id_; } |
280 private: | 280 private: |
281 Address address_; | 281 Address address_; |
282 IC::UtilityId id_; | 282 IC::UtilityId id_; |
283 }; | 283 }; |
284 | 284 |
285 | 285 |
286 enum StringStubFeedback { | |
287 DEFAULT_STRING_STUB = 0, | |
288 STRING_INDEX_OUT_OF_BOUNDS = 1 | |
289 }; | |
290 | |
291 | |
292 class CallICBase: public IC { | 286 class CallICBase: public IC { |
293 public: | 287 public: |
294 // ExtraICState bits | |
295 class StringStubState: public BitField<StringStubFeedback, 0, 1> {}; | |
296 static ExtraICState ComputeExtraICState(StringStubFeedback feedback) { | |
297 return StringStubState::encode(feedback); | |
298 } | |
299 | |
300 // Returns a JSFunction or a Failure. | 288 // Returns a JSFunction or a Failure. |
301 MUST_USE_RESULT MaybeObject* LoadFunction(Handle<Object> object, | 289 MUST_USE_RESULT MaybeObject* LoadFunction(Handle<Object> object, |
302 Handle<String> name); | 290 Handle<String> name); |
303 | 291 |
304 protected: | 292 protected: |
305 CallICBase(Code::Kind kind, Isolate* isolate) | 293 CallICBase(Code::Kind kind, Isolate* isolate) |
306 : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} | 294 : IC(EXTRA_CALL_FRAME, isolate), kind_(kind) {} |
307 | 295 |
308 // Compute a monomorphic stub if possible, otherwise return a null handle. | 296 // Compute a monomorphic stub if possible, otherwise return a null handle. |
309 Handle<Code> ComputeMonomorphicStub(LookupResult* lookup, | 297 Handle<Code> ComputeMonomorphicStub(LookupResult* lookup, |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); | 1005 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
1018 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); | 1006 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
1019 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); | 1007 DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); |
1020 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); | 1008 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
1021 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); | 1009 DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |
1022 | 1010 |
1023 | 1011 |
1024 } } // namespace v8::internal | 1012 } } // namespace v8::internal |
1025 | 1013 |
1026 #endif // V8_IC_H_ | 1014 #endif // V8_IC_H_ |
OLD | NEW |