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

Side by Side Diff: src/compiler/js-operator.h

Issue 1319383002: Drop ambiguous MaybeHandle comparison and hashing ops. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-includes-unique-2
Patch Set: 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 | « no previous file | src/compiler/js-operator.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_COMPILER_JS_OPERATOR_H_ 5 #ifndef V8_COMPILER_JS_OPERATOR_H_
6 #define V8_COMPILER_JS_OPERATOR_H_ 6 #define V8_COMPILER_JS_OPERATOR_H_
7 7
8 #include "src/runtime/runtime.h" 8 #include "src/runtime/runtime.h"
9 #include "src/unique.h" 9 #include "src/unique.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 // Forward declarations. 15 // Forward declarations.
16 class Operator; 16 class Operator;
17 struct JSOperatorGlobalCache; 17 struct JSOperatorGlobalCache;
18 18
19 19
20 // Defines a pair of {TypeFeedbackVector} and {TypeFeedbackVectorICSlot}, which 20 // Defines a pair of {TypeFeedbackVector} and {TypeFeedbackVectorICSlot}, which
21 // is used to access the type feedback for a certain {Node}. 21 // is used to access the type feedback for a certain {Node}.
22 class VectorSlotPair { 22 class VectorSlotPair {
23 public: 23 public:
24 VectorSlotPair() : slot_(FeedbackVectorICSlot::Invalid()) {} 24 VectorSlotPair() : slot_(FeedbackVectorICSlot::Invalid()) {}
25 VectorSlotPair(Handle<TypeFeedbackVector> vector, FeedbackVectorICSlot slot) 25 VectorSlotPair(Handle<TypeFeedbackVector> vector, FeedbackVectorICSlot slot)
26 : vector_(vector), slot_(slot) {} 26 : vector_(vector), slot_(slot) {}
27 27
28 bool IsValid() const { return !vector_.is_null(); } 28 bool IsValid() const { return !vector_.is_null(); }
29 29
30 MaybeHandle<TypeFeedbackVector> vector() const { return vector_; } 30 Handle<TypeFeedbackVector> vector() const { return vector_; }
31 FeedbackVectorICSlot slot() const { return slot_; } 31 FeedbackVectorICSlot slot() const { return slot_; }
32 32
33 int index() const { 33 int index() const {
34 Handle<TypeFeedbackVector> vector; 34 return vector_.is_null() ? -1 : vector_->GetIndex(slot_);
35 return vector_.ToHandle(&vector) ? vector->GetIndex(slot_) : -1;
36 } 35 }
37 36
38 private: 37 private:
39 const MaybeHandle<TypeFeedbackVector> vector_; 38 const Handle<TypeFeedbackVector> vector_;
40 const FeedbackVectorICSlot slot_; 39 const FeedbackVectorICSlot slot_;
41 }; 40 };
42 41
43 bool operator==(VectorSlotPair const&, VectorSlotPair const&); 42 bool operator==(VectorSlotPair const&, VectorSlotPair const&);
44 bool operator!=(VectorSlotPair const&, VectorSlotPair const&); 43 bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
45 44
46 size_t hash_value(VectorSlotPair const&); 45 size_t hash_value(VectorSlotPair const&);
47 46
48 enum TailCallMode { NO_TAIL_CALLS, ALLOW_TAIL_CALLS }; 47 enum TailCallMode { NO_TAIL_CALLS, ALLOW_TAIL_CALLS };
49 48
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 Zone* const zone_; 546 Zone* const zone_;
548 547
549 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder); 548 DISALLOW_COPY_AND_ASSIGN(JSOperatorBuilder);
550 }; 549 };
551 550
552 } // namespace compiler 551 } // namespace compiler
553 } // namespace internal 552 } // namespace internal
554 } // namespace v8 553 } // namespace v8
555 554
556 #endif // V8_COMPILER_JS_OPERATOR_H_ 555 #endif // V8_COMPILER_JS_OPERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/js-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698