| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_IC_H_ | 5 #ifndef V8_IC_H_ |
| 6 #define V8_IC_H_ | 6 #define V8_IC_H_ |
| 7 | 7 |
| 8 #include "src/macro-assembler.h" | 8 #include "src/macro-assembler.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 private: | 290 private: |
| 291 Address address_; | 291 Address address_; |
| 292 IC::UtilityId id_; | 292 IC::UtilityId id_; |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 | 295 |
| 296 class CallIC : public IC { | 296 class CallIC : public IC { |
| 297 public: | 297 public: |
| 298 enum CallType { METHOD, FUNCTION }; | 298 enum CallType { METHOD, FUNCTION }; |
| 299 | 299 |
| 300 class State V8_FINAL BASE_EMBEDDED { | 300 class State FINAL BASE_EMBEDDED { |
| 301 public: | 301 public: |
| 302 explicit State(ExtraICState extra_ic_state); | 302 explicit State(ExtraICState extra_ic_state); |
| 303 | 303 |
| 304 State(int argc, CallType call_type) : argc_(argc), call_type_(call_type) {} | 304 State(int argc, CallType call_type) : argc_(argc), call_type_(call_type) {} |
| 305 | 305 |
| 306 ExtraICState GetExtraICState() const; | 306 ExtraICState GetExtraICState() const; |
| 307 | 307 |
| 308 static void GenerateAheadOfTime(Isolate*, | 308 static void GenerateAheadOfTime(Isolate*, |
| 309 void (*Generate)(Isolate*, const State&)); | 309 void (*Generate)(Isolate*, const State&)); |
| 310 | 310 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 inline IC::State FeedbackToState(Handle<FixedArray> vector, | 345 inline IC::State FeedbackToState(Handle<FixedArray> vector, |
| 346 Handle<Smi> slot) const; | 346 Handle<Smi> slot) const; |
| 347 }; | 347 }; |
| 348 | 348 |
| 349 | 349 |
| 350 OStream& operator<<(OStream& os, const CallIC::State& s); | 350 OStream& operator<<(OStream& os, const CallIC::State& s); |
| 351 | 351 |
| 352 | 352 |
| 353 class LoadIC : public IC { | 353 class LoadIC : public IC { |
| 354 public: | 354 public: |
| 355 class State V8_FINAL BASE_EMBEDDED { | 355 class State FINAL BASE_EMBEDDED { |
| 356 public: | 356 public: |
| 357 explicit State(ExtraICState extra_ic_state) : state_(extra_ic_state) {} | 357 explicit State(ExtraICState extra_ic_state) : state_(extra_ic_state) {} |
| 358 | 358 |
| 359 explicit State(ContextualMode mode) | 359 explicit State(ContextualMode mode) |
| 360 : state_(ContextualModeBits::encode(mode)) {} | 360 : state_(ContextualModeBits::encode(mode)) {} |
| 361 | 361 |
| 362 ExtraICState GetExtraICState() const { return state_; } | 362 ExtraICState GetExtraICState() const { return state_; } |
| 363 | 363 |
| 364 ContextualMode contextual_mode() const { | 364 ContextualMode contextual_mode() const { |
| 365 return ContextualModeBits::decode(state_); | 365 return ContextualModeBits::decode(state_); |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 friend class IC; | 683 friend class IC; |
| 684 }; | 684 }; |
| 685 | 685 |
| 686 | 686 |
| 687 // Mode to overwrite BinaryExpression values. | 687 // Mode to overwrite BinaryExpression values. |
| 688 enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT }; | 688 enum OverwriteMode { NO_OVERWRITE, OVERWRITE_LEFT, OVERWRITE_RIGHT }; |
| 689 | 689 |
| 690 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. | 690 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. |
| 691 class BinaryOpIC : public IC { | 691 class BinaryOpIC : public IC { |
| 692 public: | 692 public: |
| 693 class State V8_FINAL BASE_EMBEDDED { | 693 class State FINAL BASE_EMBEDDED { |
| 694 public: | 694 public: |
| 695 State(Isolate* isolate, ExtraICState extra_ic_state); | 695 State(Isolate* isolate, ExtraICState extra_ic_state); |
| 696 | 696 |
| 697 State(Isolate* isolate, Token::Value op, OverwriteMode mode) | 697 State(Isolate* isolate, Token::Value op, OverwriteMode mode) |
| 698 : op_(op), | 698 : op_(op), |
| 699 mode_(mode), | 699 mode_(mode), |
| 700 left_kind_(NONE), | 700 left_kind_(NONE), |
| 701 right_kind_(NONE), | 701 right_kind_(NONE), |
| 702 result_kind_(NONE), | 702 result_kind_(NONE), |
| 703 isolate_(isolate) { | 703 isolate_(isolate) { |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 Maybe<int> fixed_right_arg_; | 807 Maybe<int> fixed_right_arg_; |
| 808 Isolate* isolate_; | 808 Isolate* isolate_; |
| 809 }; | 809 }; |
| 810 | 810 |
| 811 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {} | 811 explicit BinaryOpIC(Isolate* isolate) : IC(EXTRA_CALL_FRAME, isolate) {} |
| 812 | 812 |
| 813 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); | 813 static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); |
| 814 | 814 |
| 815 MaybeHandle<Object> Transition(Handle<AllocationSite> allocation_site, | 815 MaybeHandle<Object> Transition(Handle<AllocationSite> allocation_site, |
| 816 Handle<Object> left, | 816 Handle<Object> left, |
| 817 Handle<Object> right) V8_WARN_UNUSED_RESULT; | 817 Handle<Object> right) WARN_UNUSED_RESULT; |
| 818 }; | 818 }; |
| 819 | 819 |
| 820 | 820 |
| 821 OStream& operator<<(OStream& os, const BinaryOpIC::State& s); | 821 OStream& operator<<(OStream& os, const BinaryOpIC::State& s); |
| 822 | 822 |
| 823 | 823 |
| 824 class CompareIC : public IC { | 824 class CompareIC : public IC { |
| 825 public: | 825 public: |
| 826 // The type/state lattice is defined by the following inequations: | 826 // The type/state lattice is defined by the following inequations: |
| 827 // UNINITIALIZED < ... | 827 // UNINITIALIZED < ... |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 | 931 |
| 932 // Support functions for interceptor handlers. | 932 // Support functions for interceptor handlers. |
| 933 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); | 933 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptorOnly); |
| 934 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); | 934 DECLARE_RUNTIME_FUNCTION(LoadPropertyWithInterceptor); |
| 935 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); | 935 DECLARE_RUNTIME_FUNCTION(LoadElementWithInterceptor); |
| 936 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); | 936 DECLARE_RUNTIME_FUNCTION(StorePropertyWithInterceptor); |
| 937 } | 937 } |
| 938 } // namespace v8::internal | 938 } // namespace v8::internal |
| 939 | 939 |
| 940 #endif // V8_IC_H_ | 940 #endif // V8_IC_H_ |
| OLD | NEW |