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

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

Issue 894683003: Introduce LanguageMode, drop StrictMode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: . 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
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_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
(...skipping 7029 matching lines...) Expand 10 before | Expand all | Expand 10 after
7040 HObjectAccess access_; 7040 HObjectAccess access_;
7041 HValue* dominator_; 7041 HValue* dominator_;
7042 uint32_t bit_field_; 7042 uint32_t bit_field_;
7043 }; 7043 };
7044 7044
7045 7045
7046 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> { 7046 class HStoreNamedGeneric FINAL : public HTemplateInstruction<3> {
7047 public: 7047 public:
7048 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*, 7048 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreNamedGeneric, HValue*,
7049 Handle<String>, HValue*, 7049 Handle<String>, HValue*,
7050 StrictMode); 7050 LanguageMode);
7051 HValue* object() const { return OperandAt(0); } 7051 HValue* object() const { return OperandAt(0); }
7052 HValue* value() const { return OperandAt(1); } 7052 HValue* value() const { return OperandAt(1); }
7053 HValue* context() const { return OperandAt(2); } 7053 HValue* context() const { return OperandAt(2); }
7054 Handle<String> name() const { return name_; } 7054 Handle<String> name() const { return name_; }
7055 StrictMode strict_mode() const { return strict_mode_; } 7055 LanguageMode language_mode() const { return language_mode_; }
7056 7056
7057 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 7057 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
7058 7058
7059 Representation RequiredInputRepresentation(int index) OVERRIDE { 7059 Representation RequiredInputRepresentation(int index) OVERRIDE {
7060 return Representation::Tagged(); 7060 return Representation::Tagged();
7061 } 7061 }
7062 7062
7063 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric) 7063 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric)
7064 7064
7065 private: 7065 private:
7066 HStoreNamedGeneric(HValue* context, 7066 HStoreNamedGeneric(HValue* context, HValue* object, Handle<String> name,
7067 HValue* object, 7067 HValue* value, LanguageMode language_mode)
7068 Handle<String> name, 7068 : name_(name), language_mode_(language_mode) {
7069 HValue* value,
7070 StrictMode strict_mode)
7071 : name_(name),
7072 strict_mode_(strict_mode) {
7073 SetOperandAt(0, object); 7069 SetOperandAt(0, object);
7074 SetOperandAt(1, value); 7070 SetOperandAt(1, value);
7075 SetOperandAt(2, context); 7071 SetOperandAt(2, context);
7076 SetAllSideEffects(); 7072 SetAllSideEffects();
7077 } 7073 }
7078 7074
7079 Handle<String> name_; 7075 Handle<String> name_;
7080 StrictMode strict_mode_; 7076 LanguageMode language_mode_;
7081 }; 7077 };
7082 7078
7083 7079
7084 class HStoreKeyed FINAL 7080 class HStoreKeyed FINAL
7085 : public HTemplateInstruction<3>, public ArrayInstructionInterface { 7081 : public HTemplateInstruction<3>, public ArrayInstructionInterface {
7086 public: 7082 public:
7087 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*, 7083 DECLARE_INSTRUCTION_FACTORY_P4(HStoreKeyed, HValue*, HValue*, HValue*,
7088 ElementsKind); 7084 ElementsKind);
7089 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*, 7085 DECLARE_INSTRUCTION_FACTORY_P5(HStoreKeyed, HValue*, HValue*, HValue*,
7090 ElementsKind, StoreFieldOrKeyedMode); 7086 ElementsKind, StoreFieldOrKeyedMode);
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
7261 7257
7262 uint32_t base_offset_; 7258 uint32_t base_offset_;
7263 uint32_t bit_field_; 7259 uint32_t bit_field_;
7264 HValue* dominator_; 7260 HValue* dominator_;
7265 }; 7261 };
7266 7262
7267 7263
7268 class HStoreKeyedGeneric FINAL : public HTemplateInstruction<4> { 7264 class HStoreKeyedGeneric FINAL : public HTemplateInstruction<4> {
7269 public: 7265 public:
7270 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*, 7266 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HStoreKeyedGeneric, HValue*,
7271 HValue*, HValue*, StrictMode); 7267 HValue*, HValue*, LanguageMode);
7272 7268
7273 HValue* object() const { return OperandAt(0); } 7269 HValue* object() const { return OperandAt(0); }
7274 HValue* key() const { return OperandAt(1); } 7270 HValue* key() const { return OperandAt(1); }
7275 HValue* value() const { return OperandAt(2); } 7271 HValue* value() const { return OperandAt(2); }
7276 HValue* context() const { return OperandAt(3); } 7272 HValue* context() const { return OperandAt(3); }
7277 StrictMode strict_mode() const { return strict_mode_; } 7273 LanguageMode language_mode() const { return language_mode_; }
7278 7274
7279 Representation RequiredInputRepresentation(int index) OVERRIDE { 7275 Representation RequiredInputRepresentation(int index) OVERRIDE {
7280 // tagged[tagged] = tagged 7276 // tagged[tagged] = tagged
7281 return Representation::Tagged(); 7277 return Representation::Tagged();
7282 } 7278 }
7283 7279
7284 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT 7280 std::ostream& PrintDataTo(std::ostream& os) const OVERRIDE; // NOLINT
7285 7281
7286 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric) 7282 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric)
7287 7283
7288 private: 7284 private:
7289 HStoreKeyedGeneric(HValue* context, 7285 HStoreKeyedGeneric(HValue* context, HValue* object, HValue* key,
7290 HValue* object, 7286 HValue* value, LanguageMode language_mode)
7291 HValue* key, 7287 : language_mode_(language_mode) {
7292 HValue* value,
7293 StrictMode strict_mode)
7294 : strict_mode_(strict_mode) {
7295 SetOperandAt(0, object); 7288 SetOperandAt(0, object);
7296 SetOperandAt(1, key); 7289 SetOperandAt(1, key);
7297 SetOperandAt(2, value); 7290 SetOperandAt(2, value);
7298 SetOperandAt(3, context); 7291 SetOperandAt(3, context);
7299 SetAllSideEffects(); 7292 SetAllSideEffects();
7300 } 7293 }
7301 7294
7302 StrictMode strict_mode_; 7295 LanguageMode language_mode_;
7303 }; 7296 };
7304 7297
7305 7298
7306 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> { 7299 class HTransitionElementsKind FINAL : public HTemplateInstruction<2> {
7307 public: 7300 public:
7308 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone, 7301 inline static HTransitionElementsKind* New(Isolate* isolate, Zone* zone,
7309 HValue* context, HValue* object, 7302 HValue* context, HValue* object,
7310 Handle<Map> original_map, 7303 Handle<Map> original_map,
7311 Handle<Map> transitioned_map) { 7304 Handle<Map> transitioned_map) {
7312 return new(zone) HTransitionElementsKind(context, object, 7305 return new(zone) HTransitionElementsKind(context, object,
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
7581 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } 7574 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
7582 bool pretenure() const { return PretenureField::decode(bit_field_); } 7575 bool pretenure() const { return PretenureField::decode(bit_field_); }
7583 bool has_no_literals() const { 7576 bool has_no_literals() const {
7584 return HasNoLiteralsField::decode(bit_field_); 7577 return HasNoLiteralsField::decode(bit_field_);
7585 } 7578 }
7586 bool is_arrow() const { return IsArrowFunction(kind()); } 7579 bool is_arrow() const { return IsArrowFunction(kind()); }
7587 bool is_generator() const { return IsGeneratorFunction(kind()); } 7580 bool is_generator() const { return IsGeneratorFunction(kind()); }
7588 bool is_concise_method() const { return IsConciseMethod(kind()); } 7581 bool is_concise_method() const { return IsConciseMethod(kind()); }
7589 bool is_default_constructor() const { return IsDefaultConstructor(kind()); } 7582 bool is_default_constructor() const { return IsDefaultConstructor(kind()); }
7590 FunctionKind kind() const { return FunctionKindField::decode(bit_field_); } 7583 FunctionKind kind() const { return FunctionKindField::decode(bit_field_); }
7591 StrictMode strict_mode() const { return StrictModeField::decode(bit_field_); } 7584 LanguageMode language_mode() const {
7585 return LanguageModeField::decode(bit_field_);
7586 }
7592 7587
7593 private: 7588 private:
7594 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared, 7589 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared,
7595 bool pretenure) 7590 bool pretenure)
7596 : HTemplateInstruction<1>(HType::JSObject()), 7591 : HTemplateInstruction<1>(HType::JSObject()),
7597 shared_info_(shared), 7592 shared_info_(shared),
7598 bit_field_(FunctionKindField::encode(shared->kind()) | 7593 bit_field_(FunctionKindField::encode(shared->kind()) |
7599 PretenureField::encode(pretenure) | 7594 PretenureField::encode(pretenure) |
7600 HasNoLiteralsField::encode(shared->num_literals() == 0) | 7595 HasNoLiteralsField::encode(shared->num_literals() == 0) |
7601 StrictModeField::encode(shared->strict_mode())) { 7596 LanguageModeField::encode(shared->language_mode())) {
7602 SetOperandAt(0, context); 7597 SetOperandAt(0, context);
7603 set_representation(Representation::Tagged()); 7598 set_representation(Representation::Tagged());
7604 SetChangesFlag(kNewSpacePromotion); 7599 SetChangesFlag(kNewSpacePromotion);
7605 } 7600 }
7606 7601
7607 bool IsDeletable() const OVERRIDE { return true; } 7602 bool IsDeletable() const OVERRIDE { return true; }
7608 7603
7609 class FunctionKindField : public BitField<FunctionKind, 0, 4> {}; 7604 class FunctionKindField : public BitField<FunctionKind, 0, 4> {};
7610 class PretenureField : public BitField<bool, 5, 1> {}; 7605 class PretenureField : public BitField<bool, 5, 1> {};
7611 class HasNoLiteralsField : public BitField<bool, 6, 1> {}; 7606 class HasNoLiteralsField : public BitField<bool, 6, 1> {};
7612 class StrictModeField : public BitField<StrictMode, 7, 1> {}; 7607 STATIC_ASSERT(LANGUAGE_END == 2);
7608 class LanguageModeField : public BitField<LanguageMode, 7, 1> {};
7613 7609
7614 Handle<SharedFunctionInfo> shared_info_; 7610 Handle<SharedFunctionInfo> shared_info_;
7615 uint32_t bit_field_; 7611 uint32_t bit_field_;
7616 }; 7612 };
7617 7613
7618 7614
7619 class HTypeof FINAL : public HTemplateInstruction<2> { 7615 class HTypeof FINAL : public HTemplateInstruction<2> {
7620 public: 7616 public:
7621 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); 7617 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*);
7622 7618
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
7989 }; 7985 };
7990 7986
7991 7987
7992 7988
7993 #undef DECLARE_INSTRUCTION 7989 #undef DECLARE_INSTRUCTION
7994 #undef DECLARE_CONCRETE_INSTRUCTION 7990 #undef DECLARE_CONCRETE_INSTRUCTION
7995 7991
7996 } } // namespace v8::internal 7992 } } // namespace v8::internal
7997 7993
7998 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7994 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698