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

Side by Side Diff: src/type-feedback-vector.cc

Issue 633423002: Teach TurboFan to call vector-based ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch One. Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/functional.h"
7 #include "src/objects.h" 8 #include "src/objects.h"
8 #include "src/type-feedback-vector-inl.h" 9 #include "src/type-feedback-vector-inl.h"
9 10
10 namespace v8 { 11 namespace v8 {
11 namespace internal { 12 namespace internal {
12 13
14 bool operator==(FeedbackNode const& lhs, FeedbackNode const& rhs) {
15 return lhs.slot() == rhs.slot() && lhs.vector().is_identical_to(rhs.vector());
16 }
17
18
19 bool operator!=(FeedbackNode const& lhs, FeedbackNode const& rhs) {
20 return !(lhs == rhs);
21 }
22
23
24 size_t hash_value(FeedbackNode const& p) {
25 // TODO(mvstanton): include the vector in the hash.
26 base::hash<int> h;
27 return h(p.slot());
28 }
29
30
13 // static 31 // static
14 Handle<TypeFeedbackVector> TypeFeedbackVector::Copy( 32 Handle<TypeFeedbackVector> TypeFeedbackVector::Copy(
15 Isolate* isolate, Handle<TypeFeedbackVector> vector) { 33 Isolate* isolate, Handle<TypeFeedbackVector> vector) {
16 Handle<TypeFeedbackVector> result; 34 Handle<TypeFeedbackVector> result;
17 result = Handle<TypeFeedbackVector>::cast( 35 result = Handle<TypeFeedbackVector>::cast(
18 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector))); 36 isolate->factory()->CopyFixedArray(Handle<FixedArray>::cast(vector)));
19 return result; 37 return result;
20 } 38 }
21 } 39 }
22 } // namespace v8::internal 40 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698