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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 ConstantPoolArray* constant_pool); | 391 ConstantPoolArray* constant_pool); |
392 }; | 392 }; |
393 | 393 |
394 | 394 |
395 class LoadIC: public IC { | 395 class LoadIC: public IC { |
396 public: | 396 public: |
397 // ExtraICState bits | 397 // ExtraICState bits |
398 class ContextualModeBits: public BitField<ContextualMode, 0, 1> {}; | 398 class ContextualModeBits: public BitField<ContextualMode, 0, 1> {}; |
399 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); | 399 STATIC_ASSERT(static_cast<int>(NOT_CONTEXTUAL) == 0); |
400 | 400 |
| 401 enum RegisterInfo { |
| 402 kReceiverIndex, |
| 403 kNameIndex, |
| 404 kRegisterArgumentCount |
| 405 }; |
| 406 static Register kReceiverRegister; |
| 407 static Register kNameRegister; |
| 408 static const Register registers[kRegisterArgumentCount]; |
| 409 |
401 static ExtraICState ComputeExtraICState(ContextualMode contextual_mode) { | 410 static ExtraICState ComputeExtraICState(ContextualMode contextual_mode) { |
402 return ContextualModeBits::encode(contextual_mode); | 411 return ContextualModeBits::encode(contextual_mode); |
403 } | 412 } |
404 | 413 |
405 static ContextualMode GetContextualMode(ExtraICState state) { | 414 static ContextualMode GetContextualMode(ExtraICState state) { |
406 return ContextualModeBits::decode(state); | 415 return ContextualModeBits::decode(state); |
407 } | 416 } |
408 | 417 |
409 ContextualMode contextual_mode() const { | 418 ContextualMode contextual_mode() const { |
410 return ContextualModeBits::decode(extra_ic_state()); | 419 return ContextualModeBits::decode(extra_ic_state()); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 }; | 500 }; |
492 | 501 |
493 | 502 |
494 class KeyedLoadIC: public LoadIC { | 503 class KeyedLoadIC: public LoadIC { |
495 public: | 504 public: |
496 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) | 505 explicit KeyedLoadIC(FrameDepth depth, Isolate* isolate) |
497 : LoadIC(depth, isolate) { | 506 : LoadIC(depth, isolate) { |
498 ASSERT(target()->is_keyed_load_stub()); | 507 ASSERT(target()->is_keyed_load_stub()); |
499 } | 508 } |
500 | 509 |
| 510 static const Register registers[kRegisterArgumentCount]; |
| 511 static Register kReceiverRegister; |
| 512 static Register kNameRegister; |
| 513 |
501 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, | 514 MUST_USE_RESULT MaybeHandle<Object> Load(Handle<Object> object, |
502 Handle<Object> key); | 515 Handle<Object> key); |
503 | 516 |
504 // Code generator routines. | 517 // Code generator routines. |
505 static void GenerateMiss(MacroAssembler* masm); | 518 static void GenerateMiss(MacroAssembler* masm); |
506 static void GenerateRuntimeGetProperty(MacroAssembler* masm); | 519 static void GenerateRuntimeGetProperty(MacroAssembler* masm); |
507 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } | 520 static void GenerateInitialize(MacroAssembler* masm) { GenerateMiss(masm); } |
508 static void GeneratePreMonomorphic(MacroAssembler* masm) { | 521 static void GeneratePreMonomorphic(MacroAssembler* masm) { |
509 GenerateMiss(masm); | 522 GenerateMiss(masm); |
510 } | 523 } |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss); | 1027 DECLARE_RUNTIME_FUNCTION(ElementsTransitionAndStoreIC_Miss); |
1015 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss); | 1028 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_Miss); |
1016 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite); | 1029 DECLARE_RUNTIME_FUNCTION(BinaryOpIC_MissWithAllocationSite); |
1017 DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss); | 1030 DECLARE_RUNTIME_FUNCTION(CompareNilIC_Miss); |
1018 DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss); | 1031 DECLARE_RUNTIME_FUNCTION(ToBooleanIC_Miss); |
1019 | 1032 |
1020 | 1033 |
1021 } } // namespace v8::internal | 1034 } } // namespace v8::internal |
1022 | 1035 |
1023 #endif // V8_IC_H_ | 1036 #endif // V8_IC_H_ |
OLD | NEW |