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

Side by Side Diff: src/ic/call-optimization.h

Issue 480413008: Move PropertyAccessCompiler and CallOptimization to their own files (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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
« no previous file with comments | « src/ic/arm64/ic-compiler-arm64.cc ('k') | src/ic/call-optimization.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef V8_IC_CALL_OPTIMIZATION_H_
6 #define V8_IC_CALL_OPTIMIZATION_H_
7
8 #include "src/code-stubs.h"
9 #include "src/ic/access-compiler.h"
10 #include "src/macro-assembler.h"
11 #include "src/objects.h"
12
13 namespace v8 {
14 namespace internal {
15 // Holds information about possible function call optimizations.
16 class CallOptimization BASE_EMBEDDED {
17 public:
18 explicit CallOptimization(Handle<JSFunction> function);
19
20 bool is_constant_call() const { return !constant_function_.is_null(); }
21
22 Handle<JSFunction> constant_function() const {
23 DCHECK(is_constant_call());
24 return constant_function_;
25 }
26
27 bool is_simple_api_call() const { return is_simple_api_call_; }
28
29 Handle<FunctionTemplateInfo> expected_receiver_type() const {
30 DCHECK(is_simple_api_call());
31 return expected_receiver_type_;
32 }
33
34 Handle<CallHandlerInfo> api_call_info() const {
35 DCHECK(is_simple_api_call());
36 return api_call_info_;
37 }
38
39 enum HolderLookup { kHolderNotFound, kHolderIsReceiver, kHolderFound };
40 Handle<JSObject> LookupHolderOfExpectedType(
41 Handle<Map> receiver_map, HolderLookup* holder_lookup) const;
42
43 // Check if the api holder is between the receiver and the holder.
44 bool IsCompatibleReceiver(Handle<Object> receiver,
45 Handle<JSObject> holder) const;
46
47 private:
48 void Initialize(Handle<JSFunction> function);
49
50 // Determines whether the given function can be called using the
51 // fast api call builtin.
52 void AnalyzePossibleApiFunction(Handle<JSFunction> function);
53
54 Handle<JSFunction> constant_function_;
55 bool is_simple_api_call_;
56 Handle<FunctionTemplateInfo> expected_receiver_type_;
57 Handle<CallHandlerInfo> api_call_info_;
58 };
59 }
60 } // namespace v8::internal
61
62 #endif // V8_IC_CALL_OPTIMIZATION_H_
OLDNEW
« no previous file with comments | « src/ic/arm64/ic-compiler-arm64.cc ('k') | src/ic/call-optimization.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698