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

Side by Side Diff: runtime/vm/ic_data.h

Issue 8357034: Transitioning to new IC structure: change IC data to include function name; pass IC data instead ... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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
(Empty)
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 // Class for handling inline cache stubs
5
6 // At instance call the ECX register contains the IC-data array.
regis 2011/10/21 03:03:52 This header is not ia32 specific, so I would write
srdjan 2011/10/22 07:48:53 Done.
7 // That array contains information relevant for the call site: function name and
8 // inline cache data. Class ICData is a wrapper around that array.
9 // The array format is:
10 // 0: function-name
11 // 1: N, number of arguments checked.
12 // 2 .. (length - 1): group of checks, each check containing:
13 // - N classes.
14 // - 1 target function.
15 // Whenever first N arguments of an instance call have the same class as the
16 // check, jump to the target function.
17 // Array is terminated with a nulled check (all classes and target are NULL).
regis 2011/10/21 03:03:52 Array is null terminated (all ...
srdjan 2011/10/22 07:48:53 Done.
18 // The array does not contain Null-Classes. Null objects cannot be added.
19
20 #ifndef VM_IC_DATA_H_
21 #define VM_IC_DATA_H_
22
23 #include "vm/allocation.h"
24 #include "vm/growable_array.h"
25
26 namespace dart {
27
28 class Array;
29 class Class;
30 class Function;
31 class String;
32 class RawArray;
33 class RawString;
34
35 class ICData : public ValueObject {
36 public:
37 // Wrap IC data around 'array'.
38 explicit ICData(const Array& array);
39
40 // Create a new array with zero checks.
41 ICData(const String& function_name, intptr_t num_args_checked);
42
43 RawArray* data() const;
44
45 RawString* FunctionName() const;
46
47 intptr_t NumberOfArgumentsChecked() const;
48 intptr_t NumberOfChecks() const;
49
50 // Also updates the instance call at 'return_address_'.
51 void AddCheck(const GrowableArray<const Class*>& classes,
52 const Function& target);
53
54 void SetCheckAt(intptr_t index,
55 const GrowableArray<const Class*>& classes,
56 const Function& target);
57
58 void GetCheckAt(intptr_t index,
59 GrowableArray<const Class*>* classes,
60 Function* target) const;
61
62 static const int kNameIndex = 0;
63
64 private:
65 intptr_t ArrayElementsPerCheck() const;
66
67 const Array* data_;
68
69 static const int kNumArgsCheckedIndex = 1;
70 static const int kChecksStartIndex = 2;
71
72 DISALLOW_COPY_AND_ASSIGN(ICData);
73 };
74
75 } // namespace dart
76
77 #endif // VM_IC_DATA_H_
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_ia32.cc ('k') | runtime/vm/ic_data.cc » ('j') | runtime/vm/ic_data.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698