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

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

Issue 1329293003: [runtime] Sanitize %NewClosure runtime entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Ports Created 5 years, 3 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/hydrogen.cc ('k') | src/hydrogen-instructions.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_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 V(DeclareGlobals) \ 91 V(DeclareGlobals) \
92 V(Deoptimize) \ 92 V(Deoptimize) \
93 V(Div) \ 93 V(Div) \
94 V(DoubleBits) \ 94 V(DoubleBits) \
95 V(DummyUse) \ 95 V(DummyUse) \
96 V(EnterInlined) \ 96 V(EnterInlined) \
97 V(EnvironmentMarker) \ 97 V(EnvironmentMarker) \
98 V(ForceRepresentation) \ 98 V(ForceRepresentation) \
99 V(ForInCacheArray) \ 99 V(ForInCacheArray) \
100 V(ForInPrepareMap) \ 100 V(ForInPrepareMap) \
101 V(FunctionLiteral) \
102 V(GetCachedArrayIndex) \ 101 V(GetCachedArrayIndex) \
103 V(Goto) \ 102 V(Goto) \
104 V(HasCachedArrayIndexAndBranch) \ 103 V(HasCachedArrayIndexAndBranch) \
105 V(HasInstanceTypeAndBranch) \ 104 V(HasInstanceTypeAndBranch) \
106 V(InnerAllocatedObject) \ 105 V(InnerAllocatedObject) \
107 V(InstanceOf) \ 106 V(InstanceOf) \
108 V(InvokeFunction) \ 107 V(InvokeFunction) \
109 V(IsConstructCallAndBranch) \ 108 V(IsConstructCallAndBranch) \
110 V(HasInPrototypeChainAndBranch) \ 109 V(HasInPrototypeChainAndBranch) \
111 V(IsStringAndBranch) \ 110 V(IsStringAndBranch) \
(...skipping 7433 matching lines...) Expand 10 before | Expand all | Expand 10 after
7545 SetAllSideEffects(); 7544 SetAllSideEffects();
7546 set_type(HType::JSObject()); 7545 set_type(HType::JSObject());
7547 } 7546 }
7548 7547
7549 Handle<FixedArray> literals_; 7548 Handle<FixedArray> literals_;
7550 Handle<String> pattern_; 7549 Handle<String> pattern_;
7551 Handle<String> flags_; 7550 Handle<String> flags_;
7552 }; 7551 };
7553 7552
7554 7553
7555 class HFunctionLiteral final : public HTemplateInstruction<1> {
7556 public:
7557 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P2(HFunctionLiteral,
7558 Handle<SharedFunctionInfo>,
7559 bool);
7560 HValue* context() { return OperandAt(0); }
7561
7562 Representation RequiredInputRepresentation(int index) override {
7563 return Representation::Tagged();
7564 }
7565
7566 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral)
7567
7568 Handle<SharedFunctionInfo> shared_info() const { return shared_info_; }
7569 bool pretenure() const { return PretenureField::decode(bit_field_); }
7570 bool has_no_literals() const {
7571 return HasNoLiteralsField::decode(bit_field_);
7572 }
7573 FunctionKind kind() const { return FunctionKindField::decode(bit_field_); }
7574 LanguageMode language_mode() const {
7575 return LanguageModeField::decode(bit_field_);
7576 }
7577
7578 private:
7579 HFunctionLiteral(HValue* context, Handle<SharedFunctionInfo> shared,
7580 bool pretenure)
7581 : HTemplateInstruction<1>(HType::JSObject()),
7582 shared_info_(shared),
7583 bit_field_(FunctionKindField::encode(shared->kind()) |
7584 PretenureField::encode(pretenure) |
7585 HasNoLiteralsField::encode(shared->num_literals() == 0) |
7586 LanguageModeField::encode(shared->language_mode())) {
7587 SetOperandAt(0, context);
7588 set_representation(Representation::Tagged());
7589 SetChangesFlag(kNewSpacePromotion);
7590 }
7591
7592 bool IsDeletable() const override { return true; }
7593
7594 class FunctionKindField : public BitField<FunctionKind, 0, 8> {};
7595 class PretenureField : public BitField<bool, 8, 1> {};
7596 class HasNoLiteralsField : public BitField<bool, 9, 1> {};
7597 STATIC_ASSERT(LANGUAGE_END == 3);
7598 class LanguageModeField : public BitField<LanguageMode, 10, 2> {};
7599
7600 Handle<SharedFunctionInfo> shared_info_;
7601 uint32_t bit_field_;
7602 };
7603
7604
7605 class HTypeof final : public HTemplateInstruction<2> { 7554 class HTypeof final : public HTemplateInstruction<2> {
7606 public: 7555 public:
7607 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*); 7556 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P1(HTypeof, HValue*);
7608 7557
7609 HValue* context() const { return OperandAt(0); } 7558 HValue* context() const { return OperandAt(0); }
7610 HValue* value() const { return OperandAt(1); } 7559 HValue* value() const { return OperandAt(1); }
7611 7560
7612 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT 7561 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
7613 7562
7614 Representation RequiredInputRepresentation(int index) override { 7563 Representation RequiredInputRepresentation(int index) override {
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
8027 }; 7976 };
8028 7977
8029 7978
8030 7979
8031 #undef DECLARE_INSTRUCTION 7980 #undef DECLARE_INSTRUCTION
8032 #undef DECLARE_CONCRETE_INSTRUCTION 7981 #undef DECLARE_CONCRETE_INSTRUCTION
8033 7982
8034 } } // namespace v8::internal 7983 } } // namespace v8::internal
8035 7984
8036 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ 7985 #endif // V8_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698