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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 // Parameters accessed via CodeStubGraphBuilder::GetParameter() | 564 // Parameters accessed via CodeStubGraphBuilder::GetParameter() |
565 static const int kNumber = 0; | 565 static const int kNumber = 0; |
566 | 566 |
567 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString); | 567 DEFINE_CALL_INTERFACE_DESCRIPTOR(NumberToString); |
568 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); | 568 DEFINE_HYDROGEN_CODE_STUB(NumberToString, HydrogenCodeStub); |
569 }; | 569 }; |
570 | 570 |
571 | 571 |
572 class FastNewClosureStub : public HydrogenCodeStub { | 572 class FastNewClosureStub : public HydrogenCodeStub { |
573 public: | 573 public: |
574 FastNewClosureStub(Isolate* isolate, StrictMode strict_mode, | 574 FastNewClosureStub(Isolate* isolate, LanguageMode language_mode, |
575 FunctionKind kind) | 575 FunctionKind kind) |
576 : HydrogenCodeStub(isolate) { | 576 : HydrogenCodeStub(isolate) { |
577 DCHECK(IsValidFunctionKind(kind)); | 577 DCHECK(IsValidFunctionKind(kind)); |
578 set_sub_minor_key(StrictModeBits::encode(strict_mode) | | 578 set_sub_minor_key(LanguageModeBits::encode(language_mode) | |
579 FunctionKindBits::encode(kind)); | 579 FunctionKindBits::encode(kind)); |
580 } | 580 } |
581 | 581 |
582 StrictMode strict_mode() const { | 582 LanguageMode language_mode() const { |
583 return StrictModeBits::decode(sub_minor_key()); | 583 return LanguageModeBits::decode(sub_minor_key()); |
584 } | 584 } |
585 | 585 |
586 FunctionKind kind() const { | 586 FunctionKind kind() const { |
587 return FunctionKindBits::decode(sub_minor_key()); | 587 return FunctionKindBits::decode(sub_minor_key()); |
588 } | 588 } |
589 bool is_arrow() const { return IsArrowFunction(kind()); } | 589 bool is_arrow() const { return IsArrowFunction(kind()); } |
590 bool is_generator() const { return IsGeneratorFunction(kind()); } | 590 bool is_generator() const { return IsGeneratorFunction(kind()); } |
591 bool is_concise_method() const { return IsConciseMethod(kind()); } | 591 bool is_concise_method() const { return IsConciseMethod(kind()); } |
592 bool is_default_constructor() const { return IsDefaultConstructor(kind()); } | 592 bool is_default_constructor() const { return IsDefaultConstructor(kind()); } |
593 | 593 |
594 private: | 594 private: |
595 class StrictModeBits : public BitField<StrictMode, 0, 1> {}; | 595 STATIC_ASSERT(LANGUAGE_END == 2); |
| 596 class LanguageModeBits : public BitField<LanguageMode, 0, 1> {}; |
596 class FunctionKindBits : public BitField<FunctionKind, 1, 4> {}; | 597 class FunctionKindBits : public BitField<FunctionKind, 1, 4> {}; |
597 | 598 |
598 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); | 599 DEFINE_CALL_INTERFACE_DESCRIPTOR(FastNewClosure); |
599 DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); | 600 DEFINE_HYDROGEN_CODE_STUB(FastNewClosure, HydrogenCodeStub); |
600 }; | 601 }; |
601 | 602 |
602 | 603 |
603 class FastNewContextStub FINAL : public HydrogenCodeStub { | 604 class FastNewContextStub FINAL : public HydrogenCodeStub { |
604 public: | 605 public: |
605 static const int kMaximumSlots = 64; | 606 static const int kMaximumSlots = 64; |
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2671 | 2672 |
2672 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR | 2673 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR |
2673 #undef DEFINE_PLATFORM_CODE_STUB | 2674 #undef DEFINE_PLATFORM_CODE_STUB |
2674 #undef DEFINE_HANDLER_CODE_STUB | 2675 #undef DEFINE_HANDLER_CODE_STUB |
2675 #undef DEFINE_HYDROGEN_CODE_STUB | 2676 #undef DEFINE_HYDROGEN_CODE_STUB |
2676 #undef DEFINE_CODE_STUB | 2677 #undef DEFINE_CODE_STUB |
2677 #undef DEFINE_CODE_STUB_BASE | 2678 #undef DEFINE_CODE_STUB_BASE |
2678 } } // namespace v8::internal | 2679 } } // namespace v8::internal |
2679 | 2680 |
2680 #endif // V8_CODE_STUBS_H_ | 2681 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |