OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_FAST_ACCESSOR_ASSEMBLER_H_ | 5 #ifndef V8_FAST_ACCESSOR_ASSEMBLER_H_ |
6 #define V8_FAST_ACCESSOR_ASSEMBLER_H_ | 6 #define V8_FAST_ACCESSOR_ASSEMBLER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // with the proper internal fields present. | 59 // with the proper internal fields present. |
60 // The intended use is to call this on an object whose structure has already | 60 // The intended use is to call this on an object whose structure has already |
61 // been checked previously, e.g. the accessor's receiver, which is map-checked | 61 // been checked previously, e.g. the accessor's receiver, which is map-checked |
62 // before the fast accessor is called on it. Using this on an arbitrary object | 62 // before the fast accessor is called on it. Using this on an arbitrary object |
63 // will result in unsafe memory accesses. | 63 // will result in unsafe memory accesses. |
64 ValueId LoadInternalFieldUnchecked(ValueId value_id, int field_no); | 64 ValueId LoadInternalFieldUnchecked(ValueId value_id, int field_no); |
65 | 65 |
66 ValueId LoadValue(ValueId value_id, int offset); | 66 ValueId LoadValue(ValueId value_id, int offset); |
67 ValueId LoadObject(ValueId value_id, int offset); | 67 ValueId LoadObject(ValueId value_id, int offset); |
68 | 68 |
| 69 // Converts a machine integer to a SMI. |
| 70 ValueId ToSmi(ValueId value_id); |
| 71 |
69 // Builder / assembler functions for control flow. | 72 // Builder / assembler functions for control flow. |
70 void ReturnValue(ValueId value_id); | 73 void ReturnValue(ValueId value_id); |
71 void CheckFlagSetOrReturnNull(ValueId value_id, int mask); | 74 void CheckFlagSetOrReturnNull(ValueId value_id, int mask); |
72 void CheckNotZeroOrReturnNull(ValueId value_id); | 75 void CheckNotZeroOrReturnNull(ValueId value_id); |
73 LabelId MakeLabel(); | 76 LabelId MakeLabel(); |
74 void SetLabel(LabelId label_id); | 77 void SetLabel(LabelId label_id); |
| 78 void Goto(LabelId label_id); |
75 void CheckNotZeroOrJump(ValueId value_id, LabelId label_id); | 79 void CheckNotZeroOrJump(ValueId value_id, LabelId label_id); |
76 | 80 |
77 // C++ callback. | 81 // C++ callback. |
78 ValueId Call(FunctionCallback callback, ValueId arg); | 82 ValueId Call(FunctionCallback callback, ValueId arg); |
79 | 83 |
80 // Assemble the code. | 84 // Assemble the code. |
81 MaybeHandle<Code> Build(); | 85 MaybeHandle<Code> Build(); |
82 | 86 |
83 private: | 87 private: |
84 ValueId FromRaw(compiler::Node* node); | 88 ValueId FromRaw(compiler::Node* node); |
(...skipping 21 matching lines...) Expand all Loading... |
106 // strict as this class will be exposed at the API.) | 110 // strict as this class will be exposed at the API.) |
107 enum { kBuilding, kBuilt, kError } state_; | 111 enum { kBuilding, kBuilt, kError } state_; |
108 | 112 |
109 DISALLOW_COPY_AND_ASSIGN(FastAccessorAssembler); | 113 DISALLOW_COPY_AND_ASSIGN(FastAccessorAssembler); |
110 }; | 114 }; |
111 | 115 |
112 } // namespace internal | 116 } // namespace internal |
113 } // namespace v8 | 117 } // namespace v8 |
114 | 118 |
115 #endif // V8_FAST_ACCESSOR_ASSEMBLER_H_ | 119 #endif // V8_FAST_ACCESSOR_ASSEMBLER_H_ |
OLD | NEW |