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/ic/ic-state.h" | 8 #include "src/ic/ic-state.h" |
9 #include "src/macro-assembler.h" | 9 #include "src/macro-assembler.h" |
10 #include "src/messages.h" | 10 #include "src/messages.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return !FLAG_use_ic || state == UNINITIALIZED || state == PREMONOMORPHIC; | 70 return !FLAG_use_ic || state == UNINITIALIZED || state == PREMONOMORPHIC; |
71 } | 71 } |
72 | 72 |
73 static bool IsCleared(FeedbackNexus* nexus) { | 73 static bool IsCleared(FeedbackNexus* nexus) { |
74 InlineCacheState state = nexus->StateFromFeedback(); | 74 InlineCacheState state = nexus->StateFromFeedback(); |
75 return !FLAG_use_ic || state == UNINITIALIZED || state == PREMONOMORPHIC; | 75 return !FLAG_use_ic || state == UNINITIALIZED || state == PREMONOMORPHIC; |
76 } | 76 } |
77 | 77 |
78 static bool ICUseVector(Code::Kind kind) { | 78 static bool ICUseVector(Code::Kind kind) { |
79 return kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC || | 79 return kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC || |
80 kind == Code::CALL_IC || kind == Code::STORE_IC || | 80 kind == Code::CALL_IC || kind == Code::CONSTRUCT_IC || |
81 kind == Code::KEYED_STORE_IC; | 81 kind == Code::STORE_IC || kind == Code::KEYED_STORE_IC; |
82 } | 82 } |
83 | 83 |
84 protected: | 84 protected: |
85 // Get the call-site target; used for determining the state. | 85 // Get the call-site target; used for determining the state. |
86 Handle<Code> target() const { return target_; } | 86 Handle<Code> target() const { return target_; } |
87 | 87 |
88 Address fp() const { return fp_; } | 88 Address fp() const { return fp_; } |
89 Address pc() const { return *pc_address_; } | 89 Address pc() const { return *pc_address_; } |
90 Isolate* isolate() const { return isolate_; } | 90 Isolate* isolate() const { return isolate_; } |
91 | 91 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // Code generator routines. | 287 // Code generator routines. |
288 static Handle<Code> initialize_stub(Isolate* isolate, int argc, | 288 static Handle<Code> initialize_stub(Isolate* isolate, int argc, |
289 ConvertReceiverMode mode); | 289 ConvertReceiverMode mode); |
290 static Handle<Code> initialize_stub_in_optimized_code( | 290 static Handle<Code> initialize_stub_in_optimized_code( |
291 Isolate* isolate, int argc, ConvertReceiverMode mode); | 291 Isolate* isolate, int argc, ConvertReceiverMode mode); |
292 | 292 |
293 static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus); | 293 static void Clear(Isolate* isolate, Code* host, CallICNexus* nexus); |
294 }; | 294 }; |
295 | 295 |
296 | 296 |
| 297 class ConstructIC : public IC { |
| 298 public: |
| 299 ConstructIC(Isolate* isolate, ConstructICNexus* nexus) |
| 300 : IC(EXTRA_CALL_FRAME, isolate, nexus) { |
| 301 DCHECK(nexus != NULL); |
| 302 } |
| 303 |
| 304 static void Clear(Isolate* isolate, Code* host, ConstructICNexus* nexus); |
| 305 }; |
| 306 |
| 307 |
297 class LoadIC : public IC { | 308 class LoadIC : public IC { |
298 public: | 309 public: |
299 static ExtraICState ComputeExtraICState(TypeofMode typeof_mode, | 310 static ExtraICState ComputeExtraICState(TypeofMode typeof_mode, |
300 LanguageMode language_mode) { | 311 LanguageMode language_mode) { |
301 return LoadICState(typeof_mode, language_mode).GetExtraICState(); | 312 return LoadICState(typeof_mode, language_mode).GetExtraICState(); |
302 } | 313 } |
303 | 314 |
304 TypeofMode typeof_mode() const { | 315 TypeofMode typeof_mode() const { |
305 return LoadICState::GetTypeofMode(extra_ic_state()); | 316 return LoadICState::GetTypeofMode(extra_ic_state()); |
306 } | 317 } |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 675 |
665 // Helper for BinaryOpIC and CompareIC. | 676 // Helper for BinaryOpIC and CompareIC. |
666 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; | 677 enum InlinedSmiCheck { ENABLE_INLINED_SMI_CHECK, DISABLE_INLINED_SMI_CHECK }; |
667 void PatchInlinedSmiCode(Isolate* isolate, Address address, | 678 void PatchInlinedSmiCode(Isolate* isolate, Address address, |
668 InlinedSmiCheck check); | 679 InlinedSmiCheck check); |
669 | 680 |
670 } // namespace internal | 681 } // namespace internal |
671 } // namespace v8 | 682 } // namespace v8 |
672 | 683 |
673 #endif // V8_IC_H_ | 684 #endif // V8_IC_H_ |
OLD | NEW |