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

Side by Side Diff: src/hydrogen-instructions.h

Issue 181543002: Eliminate extended mode, and other modes clean-up (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/i18n.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5654 matching lines...) Expand 10 before | Expand all | Expand 10 after
5665 // Load and check the value of the context slot. Return undefined if it's 5665 // Load and check the value of the context slot. Return undefined if it's
5666 // the hole value. This is used for non-harmony const assignments 5666 // the hole value. This is used for non-harmony const assignments
5667 kCheckReturnUndefined 5667 kCheckReturnUndefined
5668 }; 5668 };
5669 5669
5670 HLoadContextSlot(HValue* context, Variable* var) 5670 HLoadContextSlot(HValue* context, Variable* var)
5671 : HUnaryOperation(context), slot_index_(var->index()) { 5671 : HUnaryOperation(context), slot_index_(var->index()) {
5672 ASSERT(var->IsContextSlot()); 5672 ASSERT(var->IsContextSlot());
5673 switch (var->mode()) { 5673 switch (var->mode()) {
5674 case LET: 5674 case LET:
5675 case CONST_HARMONY: 5675 case CONST:
5676 mode_ = kCheckDeoptimize; 5676 mode_ = kCheckDeoptimize;
5677 break; 5677 break;
5678 case CONST: 5678 case CONST_LEGACY:
5679 mode_ = kCheckReturnUndefined; 5679 mode_ = kCheckReturnUndefined;
5680 break; 5680 break;
5681 default: 5681 default:
5682 mode_ = kNoCheck; 5682 mode_ = kNoCheck;
5683 } 5683 }
5684 set_representation(Representation::Tagged()); 5684 set_representation(Representation::Tagged());
5685 SetFlag(kUseGVN); 5685 SetFlag(kUseGVN);
5686 SetDependsOnFlag(kContextSlots); 5686 SetDependsOnFlag(kContextSlots);
5687 } 5687 }
5688 5688
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
6634 bool has_transition_ : 1; 6634 bool has_transition_ : 1;
6635 bool is_stable_ : 1; 6635 bool is_stable_ : 1;
6636 StoreFieldOrKeyedMode store_mode_ : 1; 6636 StoreFieldOrKeyedMode store_mode_ : 1;
6637 }; 6637 };
6638 6638
6639 6639
6640 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> { 6640 class HStoreNamedGeneric V8_FINAL : public HTemplateInstruction<3> {
6641 public: 6641 public:
6642 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, 6642 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*,
6643 Handle<String>, HValue*, 6643 Handle<String>, HValue*,
6644 StrictModeFlag); 6644 StrictMode);
6645 HValue* object() { return OperandAt(0); } 6645 HValue* object() { return OperandAt(0); }
6646 HValue* value() { return OperandAt(1); } 6646 HValue* value() { return OperandAt(1); }
6647 HValue* context() { return OperandAt(2); } 6647 HValue* context() { return OperandAt(2); }
6648 Handle<String> name() { return name_; } 6648 Handle<String> name() { return name_; }
6649 StrictModeFlag strict_mode_flag() { return strict_mode_flag_; } 6649 StrictMode strict_mode() { return strict_mode_; }
6650 6650
6651 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 6651 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
6652 6652
6653 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 6653 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
6654 return Representation::Tagged(); 6654 return Representation::Tagged();
6655 } 6655 }
6656 6656
6657 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) 6657 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric)
6658 6658
6659 private: 6659 private:
6660 HStoreNamedGeneric(HValue* context, 6660 HStoreNamedGeneric(HValue* context,
6661 HValue* object, 6661 HValue* object,
6662 Handle<String> name, 6662 Handle<String> name,
6663 HValue* value, 6663 HValue* value,
6664 StrictModeFlag strict_mode_flag) 6664 StrictMode strict_mode)
6665 : name_(name), 6665 : name_(name),
6666 strict_mode_flag_(strict_mode_flag) { 6666 strict_mode_(strict_mode) {
6667 SetOperandAt(0, object); 6667 SetOperandAt(0, object);
6668 SetOperandAt(1, value); 6668 SetOperandAt(1, value);
6669 SetOperandAt(2, context); 6669 SetOperandAt(2, context);
6670 SetAllSideEffects(); 6670 SetAllSideEffects();
6671 } 6671 }
6672 6672
6673 Handle<String> name_; 6673 Handle<String> name_;
6674 StrictModeFlag strict_mode_flag_; 6674 StrictMode strict_mode_;
6675 }; 6675 };
6676 6676
6677 6677
6678 class HStoreKeyed V8_FINAL 6678 class HStoreKeyed V8_FINAL
6679 : public HTemplateInstruction<3>, public ArrayInstructionInterface { 6679 : public HTemplateInstruction<3>, public ArrayInstructionInterface {
6680 public: 6680 public:
6681 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, 6681 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*,
6682 ElementsKind); 6682 ElementsKind);
6683 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, 6683 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*,
6684 ElementsKind, StoreFieldOrKeyedMode); 6684 ElementsKind, StoreFieldOrKeyedMode);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
6846 bool is_dehoisted_ : 1; 6846 bool is_dehoisted_ : 1;
6847 bool is_uninitialized_ : 1; 6847 bool is_uninitialized_ : 1;
6848 StoreFieldOrKeyedMode store_mode_: 1; 6848 StoreFieldOrKeyedMode store_mode_: 1;
6849 HValue* new_space_dominator_; 6849 HValue* new_space_dominator_;
6850 }; 6850 };
6851 6851
6852 6852
6853 class HStoreKeyedGeneric V8_FINAL : public HTemplateInstruction<4> { 6853 class HStoreKeyedGeneric V8_FINAL : public HTemplateInstruction<4> {
6854 public: 6854 public:
6855 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, 6855 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*,
6856 HValue*, HValue*, StrictModeFlag); 6856 HValue*, HValue*, StrictMode);
6857 6857
6858 HValue* object() { return OperandAt(0); } 6858 HValue* object() { return OperandAt(0); }
6859 HValue* key() { return OperandAt(1); } 6859 HValue* key() { return OperandAt(1); }
6860 HValue* value() { return OperandAt(2); } 6860 HValue* value() { return OperandAt(2); }
6861 HValue* context() { return OperandAt(3); } 6861 HValue* context() { return OperandAt(3); }
6862 StrictModeFlag strict_mode_flag() { return strict_mode_flag_; } 6862 StrictMode strict_mode() { return strict_mode_; }
6863 6863
6864 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 6864 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
6865 // tagged[tagged] = tagged 6865 // tagged[tagged] = tagged
6866 return Representation::Tagged(); 6866 return Representation::Tagged();
6867 } 6867 }
6868 6868
6869 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; 6869 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
6870 6870
6871 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) 6871 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric)
6872 6872
6873 private: 6873 private:
6874 HStoreKeyedGeneric(HValue* context, 6874 HStoreKeyedGeneric(HValue* context,
6875 HValue* object, 6875 HValue* object,
6876 HValue* key, 6876 HValue* key,
6877 HValue* value, 6877 HValue* value,
6878 StrictModeFlag strict_mode_flag) 6878 StrictMode strict_mode)
6879 : strict_mode_flag_(strict_mode_flag) { 6879 : strict_mode_(strict_mode) {
6880 SetOperandAt(0, object); 6880 SetOperandAt(0, object);
6881 SetOperandAt(1, key); 6881 SetOperandAt(1, key);
6882 SetOperandAt(2, value); 6882 SetOperandAt(2, value);
6883 SetOperandAt(3, context); 6883 SetOperandAt(3, context);
6884 SetAllSideEffects(); 6884 SetAllSideEffects();
6885 } 6885 }
6886 6886
6887 StrictModeFlag strict_mode_flag_; 6887 StrictMode strict_mode_;
6888 }; 6888 };
6889 6889
6890 6890
6891 class HTransitionElementsKind V8_FINAL : public HTemplateInstruction<2> { 6891 class HTransitionElementsKind V8_FINAL : public HTemplateInstruction<2> {
6892 public: 6892 public:
6893 inline static HTransitionElementsKind* New(Zone* zone, 6893 inline static HTransitionElementsKind* New(Zone* zone,
6894 HValue* context, 6894 HValue* context,
6895 HValue* object, 6895 HValue* object,
6896 Handle<Map> original_map, 6896 Handle<Map> original_map,
6897 Handle<Map> transitioned_map) { 6897 Handle<Map> transitioned_map) {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
7163 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE { 7163 virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
7164 return Representation::Tagged(); 7164 return Representation::Tagged();
7165 } 7165 }
7166 7166
7167 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral) 7167 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral)
7168 7168
7169 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } 7169 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
7170 bool pretenure() const { return pretenure_; } 7170 bool pretenure() const { return pretenure_; }
7171 bool has_no_literals() const { return has_no_literals_; } 7171 bool has_no_literals() const { return has_no_literals_; }
7172 bool is_generator() const { return is_generator_; } 7172 bool is_generator() const { return is_generator_; }
7173 LanguageMode language_mode() const { return language_mode_; } 7173 StrictMode strict_mode() const { return strict_mode_; }
7174 7174
7175 private: 7175 private:
7176 HFunctionLiteral(HValue* context, 7176 HFunctionLiteral(HValue* context,
7177 Handle<SharedFunctionInfo> shared, 7177 Handle<SharedFunctionInfo> shared,
7178 bool pretenure) 7178 bool pretenure)
7179 : HTemplateInstruction<1>(HType::JSObject()), 7179 : HTemplateInstruction<1>(HType::JSObject()),
7180 shared_info_(shared), 7180 shared_info_(shared),
7181 pretenure_(pretenure), 7181 pretenure_(pretenure),
7182 has_no_literals_(shared->num_literals() == 0), 7182 has_no_literals_(shared->num_literals() == 0),
7183 is_generator_(shared->is_generator()), 7183 is_generator_(shared->is_generator()),
7184 language_mode_(shared->language_mode()) { 7184 strict_mode_(shared->strict_mode()) {
7185 SetOperandAt(0, context); 7185 SetOperandAt(0, context);
7186 set_representation(Representation::Tagged()); 7186 set_representation(Representation::Tagged());
7187 SetChangesFlag(kNewSpacePromotion); 7187 SetChangesFlag(kNewSpacePromotion);
7188 } 7188 }
7189 7189
7190 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7190 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7191 7191
7192 Handle<SharedFunctionInfo> shared_info_; 7192 Handle<SharedFunctionInfo> shared_info_;
7193 bool pretenure_ : 1; 7193 bool pretenure_ : 1;
7194 bool has_no_literals_ : 1; 7194 bool has_no_literals_ : 1;
7195 bool is_generator_ : 1; 7195 bool is_generator_ : 1;
7196 LanguageMode language_mode_; 7196 StrictMode strict_mode_;
7197 }; 7197 };
7198 7198
7199 7199
7200 class HTypeof V8_FINAL : public HTemplateInstruction<2> { 7200 class HTypeof V8_FINAL : public HTemplateInstruction<2> {
7201 public: 7201 public:
7202 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); 7202 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*);
7203 7203
7204 HValue* context() { return OperandAt(0); } 7204 HValue* context() { return OperandAt(0); }
7205 HValue* value() { return OperandAt(1); } 7205 HValue* value() { return OperandAt(1); }
7206 7206
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
7519 virtual bool IsDeletable() const V8_OVERRIDE { return true; } 7519 virtual bool IsDeletable() const V8_OVERRIDE { return true; }
7520 }; 7520 };
7521 7521
7522 7522
7523 #undef DECLARE_INSTRUCTION 7523 #undef DECLARE_INSTRUCTION
7524 #undef DECLARE_CONCRETE_INSTRUCTION 7524 #undef DECLARE_CONCRETE_INSTRUCTION
7525 7525
7526 } } // namespace v8::internal 7526 } } // namespace v8::internal
7527 7527
7528 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7528 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698