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

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

Issue 1731303002: [crankshaft] Remove useless HCallFunction instruction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/crankshaft/hydrogen.cc ('k') | src/crankshaft/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_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 5 #ifndef V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 6 #define V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
7 7
8 #include <cstring> 8 #include <cstring>
9 #include <iosfwd> 9 #include <iosfwd>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 V(ArgumentsElements) \ 53 V(ArgumentsElements) \
54 V(ArgumentsLength) \ 54 V(ArgumentsLength) \
55 V(ArgumentsObject) \ 55 V(ArgumentsObject) \
56 V(Bitwise) \ 56 V(Bitwise) \
57 V(BlockEntry) \ 57 V(BlockEntry) \
58 V(BoundsCheck) \ 58 V(BoundsCheck) \
59 V(BoundsCheckBaseIndexInformation) \ 59 V(BoundsCheckBaseIndexInformation) \
60 V(Branch) \ 60 V(Branch) \
61 V(CallWithDescriptor) \ 61 V(CallWithDescriptor) \
62 V(CallJSFunction) \ 62 V(CallJSFunction) \
63 V(CallFunction) \
64 V(CallNewArray) \ 63 V(CallNewArray) \
65 V(CallRuntime) \ 64 V(CallRuntime) \
66 V(CapturedObject) \ 65 V(CapturedObject) \
67 V(Change) \ 66 V(Change) \
68 V(CheckArrayBufferNotNeutered) \ 67 V(CheckArrayBufferNotNeutered) \
69 V(CheckHeapObject) \ 68 V(CheckHeapObject) \
70 V(CheckInstanceType) \ 69 V(CheckInstanceType) \
71 V(CheckMaps) \ 70 V(CheckMaps) \
72 V(CheckMapValue) \ 71 V(CheckMapValue) \
73 V(CheckSmi) \ 72 V(CheckSmi) \
(...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2257 2256
2258 class HCallWithDescriptor final : public HInstruction { 2257 class HCallWithDescriptor final : public HInstruction {
2259 public: 2258 public:
2260 static HCallWithDescriptor* New(Isolate* isolate, Zone* zone, HValue* context, 2259 static HCallWithDescriptor* New(Isolate* isolate, Zone* zone, HValue* context,
2261 HValue* target, int argument_count, 2260 HValue* target, int argument_count,
2262 CallInterfaceDescriptor descriptor, 2261 CallInterfaceDescriptor descriptor,
2263 const Vector<HValue*>& operands, 2262 const Vector<HValue*>& operands,
2264 CallMode call_mode = NORMAL_CALL) { 2263 CallMode call_mode = NORMAL_CALL) {
2265 HCallWithDescriptor* res = new (zone) HCallWithDescriptor( 2264 HCallWithDescriptor* res = new (zone) HCallWithDescriptor(
2266 target, argument_count, descriptor, operands, call_mode, zone); 2265 target, argument_count, descriptor, operands, call_mode, zone);
2267 DCHECK(operands.length() == res->GetParameterCount()); 2266 DCHECK_EQ(operands.length(), res->GetParameterCount());
2268 return res; 2267 return res;
2269 } 2268 }
2270 2269
2271 int OperandCount() const final { return values_.length(); } 2270 int OperandCount() const final { return values_.length(); }
2272 HValue* OperandAt(int index) const final { return values_[index]; } 2271 HValue* OperandAt(int index) const final { return values_[index]; }
2273 2272
2274 Representation RequiredInputRepresentation(int index) final { 2273 Representation RequiredInputRepresentation(int index) final {
2275 if (index == 0 || index == 1) { 2274 if (index == 0 || index == 1) {
2276 // Target + context 2275 // Target + context
2277 return Representation::Tagged(); 2276 return Representation::Tagged();
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
2383 : HBinaryCall(context, function, argument_count), 2382 : HBinaryCall(context, function, argument_count),
2384 has_stack_check_(false) { 2383 has_stack_check_(false) {
2385 } 2384 }
2386 2385
2387 Handle<JSFunction> known_function_; 2386 Handle<JSFunction> known_function_;
2388 int formal_parameter_count_; 2387 int formal_parameter_count_;
2389 bool has_stack_check_; 2388 bool has_stack_check_;
2390 }; 2389 };
2391 2390
2392 2391
2393 class HCallFunction final : public HBinaryCall {
2394 public:
2395 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P3(HCallFunction, HValue*, int,
2396 ConvertReceiverMode);
2397
2398 HValue* context() const { return first(); }
2399 HValue* function() const { return second(); }
2400
2401 ConvertReceiverMode convert_mode() const {
2402 return ConvertReceiverModeField::decode(bit_field_);
2403 }
2404 FeedbackVectorSlot slot() const { return slot_; }
2405 Handle<TypeFeedbackVector> feedback_vector() const {
2406 return feedback_vector_;
2407 }
2408 bool HasVectorAndSlot() const { return !feedback_vector_.is_null(); }
2409 void SetVectorAndSlot(Handle<TypeFeedbackVector> vector,
2410 FeedbackVectorSlot slot) {
2411 feedback_vector_ = vector;
2412 slot_ = slot;
2413 }
2414
2415 DECLARE_CONCRETE_INSTRUCTION(CallFunction)
2416
2417 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
2418
2419 int argument_delta() const override { return -argument_count(); }
2420
2421 private:
2422 HCallFunction(HValue* context, HValue* function, int argument_count,
2423 ConvertReceiverMode convert_mode)
2424 : HBinaryCall(context, function, argument_count),
2425 bit_field_(ConvertReceiverModeField::encode(convert_mode)) {}
2426 Handle<TypeFeedbackVector> feedback_vector_;
2427 FeedbackVectorSlot slot_;
2428
2429 class ConvertReceiverModeField : public BitField<ConvertReceiverMode, 0, 2> {
2430 };
2431
2432 uint32_t bit_field_;
2433 };
2434
2435
2436 class HCallNewArray final : public HBinaryCall { 2392 class HCallNewArray final : public HBinaryCall {
2437 public: 2393 public:
2438 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray, HValue*, int, 2394 DECLARE_INSTRUCTION_WITH_CONTEXT_FACTORY_P4(HCallNewArray, HValue*, int,
2439 ElementsKind, 2395 ElementsKind,
2440 Handle<AllocationSite>); 2396 Handle<AllocationSite>);
2441 2397
2442 HValue* context() { return first(); } 2398 HValue* context() { return first(); }
2443 HValue* constructor() { return second(); } 2399 HValue* constructor() { return second(); }
2444 2400
2445 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT 2401 std::ostream& PrintDataTo(std::ostream& os) const override; // NOLINT
(...skipping 5222 matching lines...) Expand 10 before | Expand all | Expand 10 after
7668 7624
7669 7625
7670 7626
7671 #undef DECLARE_INSTRUCTION 7627 #undef DECLARE_INSTRUCTION
7672 #undef DECLARE_CONCRETE_INSTRUCTION 7628 #undef DECLARE_CONCRETE_INSTRUCTION
7673 7629
7674 } // namespace internal 7630 } // namespace internal
7675 } // namespace v8 7631 } // namespace v8
7676 7632
7677 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_ 7633 #endif // V8_CRANKSHAFT_HYDROGEN_INSTRUCTIONS_H_
OLDNEW
« 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