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_CODE_STUBS_H_ | 5 #ifndef V8_CODE_STUBS_H_ |
6 #define V8_CODE_STUBS_H_ | 6 #define V8_CODE_STUBS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 static const int kNumber = 0; | 585 static const int kNumber = 0; |
586 | 586 |
587 private: | 587 private: |
588 virtual Major MajorKey() const V8_OVERRIDE { return NumberToString; } | 588 virtual Major MajorKey() const V8_OVERRIDE { return NumberToString; } |
589 virtual int NotMissMinorKey() const V8_OVERRIDE { return 0; } | 589 virtual int NotMissMinorKey() const V8_OVERRIDE { return 0; } |
590 }; | 590 }; |
591 | 591 |
592 | 592 |
593 class FastNewClosureStub : public HydrogenCodeStub { | 593 class FastNewClosureStub : public HydrogenCodeStub { |
594 public: | 594 public: |
595 FastNewClosureStub(Isolate* isolate, | 595 FastNewClosureStub(Isolate* isolate, StrictMode strict_mode, |
596 StrictMode strict_mode, | 596 FunctionKind kind) |
597 bool is_generator) | 597 : HydrogenCodeStub(isolate), strict_mode_(strict_mode), kind_(kind) {} |
598 : HydrogenCodeStub(isolate), | |
599 strict_mode_(strict_mode), | |
600 is_generator_(is_generator) { } | |
601 | 598 |
602 virtual Handle<Code> GenerateCode() V8_OVERRIDE; | 599 virtual Handle<Code> GenerateCode() V8_OVERRIDE; |
603 | 600 |
604 virtual void InitializeInterfaceDescriptor( | 601 virtual void InitializeInterfaceDescriptor( |
605 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; | 602 CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE; |
606 | 603 |
607 static void InstallDescriptors(Isolate* isolate); | 604 static void InstallDescriptors(Isolate* isolate); |
608 | 605 |
609 StrictMode strict_mode() const { return strict_mode_; } | 606 StrictMode strict_mode() const { return strict_mode_; } |
610 bool is_generator() const { return is_generator_; } | 607 FunctionKind kind() const { return kind_; } |
| 608 bool is_arrow() const { return IsArrowFunction(kind_); } |
| 609 bool is_generator() const { return IsGeneratorFunction(kind_); } |
| 610 bool is_concise_method() const { return IsConciseMethod(kind_); } |
611 | 611 |
612 private: | 612 private: |
613 class StrictModeBits: public BitField<bool, 0, 1> {}; | 613 class StrictModeBits : public BitField<bool, 0, 1> {}; |
614 class IsGeneratorBits: public BitField<bool, 1, 1> {}; | 614 class FunctionKindBits : public BitField<FunctionKind, 1, 3> {}; |
615 | 615 |
616 Major MajorKey() const { return FastNewClosure; } | 616 Major MajorKey() const { return FastNewClosure; } |
617 int NotMissMinorKey() const { | 617 int NotMissMinorKey() const { |
618 return StrictModeBits::encode(strict_mode_ == STRICT) | | 618 return StrictModeBits::encode(strict_mode_ == STRICT) | |
619 IsGeneratorBits::encode(is_generator_); | 619 FunctionKindBits::encode(kind_); |
620 } | 620 } |
621 | 621 |
622 StrictMode strict_mode_; | 622 StrictMode strict_mode_; |
623 bool is_generator_; | 623 FunctionKind kind_; |
624 }; | 624 }; |
625 | 625 |
626 | 626 |
627 class FastNewContextStub V8_FINAL : public HydrogenCodeStub { | 627 class FastNewContextStub V8_FINAL : public HydrogenCodeStub { |
628 public: | 628 public: |
629 static const int kMaximumSlots = 64; | 629 static const int kMaximumSlots = 64; |
630 | 630 |
631 FastNewContextStub(Isolate* isolate, int slots) | 631 FastNewContextStub(Isolate* isolate, int slots) |
632 : HydrogenCodeStub(isolate), slots_(slots) { | 632 : HydrogenCodeStub(isolate), slots_(slots) { |
633 DCHECK(slots_ > 0 && slots_ <= kMaximumSlots); | 633 DCHECK(slots_ > 0 && slots_ <= kMaximumSlots); |
(...skipping 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2527 | 2527 |
2528 | 2528 |
2529 class CallDescriptors { | 2529 class CallDescriptors { |
2530 public: | 2530 public: |
2531 static void InitializeForIsolate(Isolate* isolate); | 2531 static void InitializeForIsolate(Isolate* isolate); |
2532 }; | 2532 }; |
2533 | 2533 |
2534 } } // namespace v8::internal | 2534 } } // namespace v8::internal |
2535 | 2535 |
2536 #endif // V8_CODE_STUBS_H_ | 2536 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |