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