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

Unified Diff: src/crankshaft/hydrogen-instructions.h

Issue 2391043005: [crankshaft] Remove HLoadKeyedGeneric and use HCallWithDescriptor to call KeyedLoadIC. (Closed)
Patch Set: Rebasing Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/hydrogen-instructions.h
diff --git a/src/crankshaft/hydrogen-instructions.h b/src/crankshaft/hydrogen-instructions.h
index 3b6bc48e16761ae504b322915bf9b9dbf6a7d7cd..9aceb0ebaf4e83e55b450fe0469e84cc9000dc1c 100644
--- a/src/crankshaft/hydrogen-instructions.h
+++ b/src/crankshaft/hydrogen-instructions.h
@@ -106,7 +106,6 @@ class SmallMapList;
V(LoadFieldByIndex) \
V(LoadFunctionPrototype) \
V(LoadKeyed) \
- V(LoadKeyedGeneric) \
V(LoadNamedField) \
V(LoadRoot) \
V(MathFloorOfDiv) \
@@ -2159,7 +2158,19 @@ class HCallWithDescriptor final : public HInstruction {
TailCallMode syntactic_tail_call_mode = TailCallMode::kDisallow,
TailCallMode tail_call_mode = TailCallMode::kDisallow) {
HCallWithDescriptor* res = new (zone) HCallWithDescriptor(
- context, target, argument_count, descriptor, operands,
+ Code::STUB, context, target, argument_count, descriptor, operands,
+ syntactic_tail_call_mode, tail_call_mode, zone);
+ return res;
+ }
+
+ static HCallWithDescriptor* New(
+ Isolate* isolate, Zone* zone, HValue* context, Code::Kind kind,
+ HValue* target, int argument_count, CallInterfaceDescriptor descriptor,
+ const Vector<HValue*>& operands,
+ TailCallMode syntactic_tail_call_mode = TailCallMode::kDisallow,
+ TailCallMode tail_call_mode = TailCallMode::kDisallow) {
+ HCallWithDescriptor* res = new (zone) HCallWithDescriptor(
+ kind, context, target, argument_count, descriptor, operands,
syntactic_tail_call_mode, tail_call_mode, zone);
return res;
}
@@ -2192,6 +2203,8 @@ class HCallWithDescriptor final : public HInstruction {
}
bool IsTailCall() const { return tail_call_mode() == TailCallMode::kAllow; }
+ Code::Kind kind() const { return KindField::decode(bit_field_); }
+
virtual int argument_count() const {
return argument_count_;
}
@@ -2207,12 +2220,14 @@ class HCallWithDescriptor final : public HInstruction {
return OperandAt(index + 2);
}
+ HValue* Canonicalize() override;
+
std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
private:
// The argument count includes the receiver.
- HCallWithDescriptor(HValue* context, HValue* target, int argument_count,
- CallInterfaceDescriptor descriptor,
+ HCallWithDescriptor(Code::Kind kind, HValue* context, HValue* target,
+ int argument_count, CallInterfaceDescriptor descriptor,
const Vector<HValue*>& operands,
TailCallMode syntactic_tail_call_mode,
TailCallMode tail_call_mode, Zone* zone)
@@ -2221,7 +2236,8 @@ class HCallWithDescriptor final : public HInstruction {
argument_count_(argument_count),
bit_field_(
TailCallModeField::encode(tail_call_mode) |
- SyntacticTailCallModeField::encode(syntactic_tail_call_mode)) {
+ SyntacticTailCallModeField::encode(syntactic_tail_call_mode) |
+ KindField::encode(kind)) {
DCHECK_EQ(operands.length(), GetParameterCount());
// We can only tail call without any stack arguments.
DCHECK(tail_call_mode != TailCallMode::kAllow || argument_count == 0);
@@ -2251,6 +2267,8 @@ class HCallWithDescriptor final : public HInstruction {
class TailCallModeField : public BitField<TailCallMode, 0, 1> {};
class SyntacticTailCallModeField
: public BitField<TailCallMode, TailCallModeField::kNext, 1> {};
+ class KindField
+ : public BitField<Code::Kind, SyntacticTailCallModeField::kNext, 5> {};
uint32_t bit_field_;
};
@@ -6041,47 +6059,6 @@ class HLoadKeyed final : public HTemplateInstruction<4>,
};
-class HLoadKeyedGeneric final : public HTemplateInstruction<3> {
- public:
- DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HLoadKeyedGeneric, HValue*,
- HValue*,
- Handle<TypeFeedbackVector>,
- FeedbackVectorSlot);
- HValue* object() const { return OperandAt(0); }
- HValue* key() const { return OperandAt(1); }
- HValue* context() const { return OperandAt(2); }
- FeedbackVectorSlot slot() const { return slot_; }
- Handle<TypeFeedbackVector> feedback_vector() const {
- return feedback_vector_;
- }
-
- std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
-
- Representation RequiredInputRepresentation(int index) override {
- // tagged[tagged]
- return Representation::Tagged();
- }
-
- HValue* Canonicalize() override;
-
- DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric)
-
- private:
- HLoadKeyedGeneric(HValue* context, HValue* obj, HValue* key,
- Handle<TypeFeedbackVector> vector, FeedbackVectorSlot slot)
- : feedback_vector_(vector), slot_(slot) {
- set_representation(Representation::Tagged());
- SetOperandAt(0, obj);
- SetOperandAt(1, key);
- SetOperandAt(2, context);
- SetAllSideEffects();
- }
-
- Handle<TypeFeedbackVector> feedback_vector_;
- FeedbackVectorSlot slot_;
-};
-
-
// Indicates whether the store is a store to an entry that was previously
// initialized or not.
enum StoreFieldOrKeyedMode {
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/crankshaft/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698