Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(849)

Side by Side Diff: src/code-stubs.h

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased (w/ conflicts) Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 2067 matching lines...) Expand 10 before | Expand all | Expand 10 after
2673 2674
2674 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR 2675 #undef DEFINE_CALL_INTERFACE_DESCRIPTOR
2675 #undef DEFINE_PLATFORM_CODE_STUB 2676 #undef DEFINE_PLATFORM_CODE_STUB
2676 #undef DEFINE_HANDLER_CODE_STUB 2677 #undef DEFINE_HANDLER_CODE_STUB
2677 #undef DEFINE_HYDROGEN_CODE_STUB 2678 #undef DEFINE_HYDROGEN_CODE_STUB
2678 #undef DEFINE_CODE_STUB 2679 #undef DEFINE_CODE_STUB
2679 #undef DEFINE_CODE_STUB_BASE 2680 #undef DEFINE_CODE_STUB_BASE
2680 } } // namespace v8::internal 2681 } } // namespace v8::internal
2681 2682
2682 #endif // V8_CODE_STUBS_H_ 2683 #endif // V8_CODE_STUBS_H_
OLDNEW
« no previous file with comments | « src/code-factory.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698