OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 11 matching lines...) Expand all Loading... |
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 28 #ifndef V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
29 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 29 #define V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
30 | 30 |
31 #include "assembler.h" | 31 #include "assembler.h" |
| 32 #include "v8globals.h" |
32 | 33 |
33 namespace v8 { | 34 namespace v8 { |
34 namespace internal { | 35 namespace internal { |
35 | 36 |
36 // Flags used for the AllocateInNewSpace functions. | 37 // Flags used for the AllocateInNewSpace functions. |
37 enum AllocationFlags { | 38 enum AllocationFlags { |
38 // No special flags. | 39 // No special flags. |
39 NO_ALLOCATION_FLAGS = 0, | 40 NO_ALLOCATION_FLAGS = 0, |
40 // Return the pointer to the allocated already tagged as a heap object. | 41 // Return the pointer to the allocated already tagged as a heap object. |
41 TAG_OBJECT = 1 << 0, | 42 TAG_OBJECT = 1 << 0, |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 205 |
205 // Compare instance type for map. | 206 // Compare instance type for map. |
206 void CmpInstanceType(Register map, InstanceType type); | 207 void CmpInstanceType(Register map, InstanceType type); |
207 | 208 |
208 // Check if the map of an object is equal to a specified map and | 209 // Check if the map of an object is equal to a specified map and |
209 // branch to label if not. Skip the smi check if not required | 210 // branch to label if not. Skip the smi check if not required |
210 // (object is known to be a heap object) | 211 // (object is known to be a heap object) |
211 void CheckMap(Register obj, | 212 void CheckMap(Register obj, |
212 Handle<Map> map, | 213 Handle<Map> map, |
213 Label* fail, | 214 Label* fail, |
214 bool is_heap_object); | 215 SmiCheckType smi_check_type); |
215 | 216 |
216 // Check if the object in register heap_object is a string. Afterwards the | 217 // Check if the object in register heap_object is a string. Afterwards the |
217 // register map contains the object map and the register instance_type | 218 // register map contains the object map and the register instance_type |
218 // contains the instance_type. The registers map and instance_type can be the | 219 // contains the instance_type. The registers map and instance_type can be the |
219 // same in which case it contains the instance type afterwards. Either of the | 220 // same in which case it contains the instance type afterwards. Either of the |
220 // registers map and instance_type can be the same as heap_object. | 221 // registers map and instance_type can be the same as heap_object. |
221 Condition IsObjectStringType(Register heap_object, | 222 Condition IsObjectStringType(Register heap_object, |
222 Register map, | 223 Register map, |
223 Register instance_type); | 224 Register instance_type); |
224 | 225 |
225 // Check if a heap object's type is in the JSObject range, not including | 226 // Check if a heap object's type is in the JSObject range, not including |
226 // JSFunction. The object's map will be loaded in the map register. | 227 // JSFunction. The object's map will be loaded in the map register. |
227 // Any or all of the three registers may be the same. | 228 // Any or all of the three registers may be the same. |
228 // The contents of the scratch register will always be overwritten. | 229 // The contents of the scratch register will always be overwritten. |
229 void IsObjectJSObjectType(Register heap_object, | 230 void IsObjectJSObjectType(Register heap_object, |
230 Register map, | 231 Register map, |
231 Register scratch, | 232 Register scratch, |
232 Label* fail); | 233 Label* fail); |
233 | 234 |
234 // The contents of the scratch register will be overwritten. | 235 // The contents of the scratch register will be overwritten. |
235 void IsInstanceJSObjectType(Register map, Register scratch, Label* fail); | 236 void IsInstanceJSObjectType(Register map, Register scratch, Label* fail); |
236 | 237 |
237 // FCmp is similar to integer cmp, but requires unsigned | 238 // FCmp is similar to integer cmp, but requires unsigned |
238 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). | 239 // jcc instructions (je, ja, jae, jb, jbe, je, and jz). |
239 void FCmp(); | 240 void FCmp(); |
240 | 241 |
| 242 void ClampUint8(Register reg); |
| 243 |
| 244 void ClampDoubleToUint8(XMMRegister input_reg, |
| 245 XMMRegister scratch_reg, |
| 246 Register result_reg); |
| 247 |
| 248 |
241 // Smi tagging support. | 249 // Smi tagging support. |
242 void SmiTag(Register reg) { | 250 void SmiTag(Register reg) { |
243 ASSERT(kSmiTag == 0); | 251 ASSERT(kSmiTag == 0); |
244 ASSERT(kSmiTagSize == 1); | 252 ASSERT(kSmiTagSize == 1); |
245 add(reg, Operand(reg)); | 253 add(reg, Operand(reg)); |
246 } | 254 } |
247 void SmiUntag(Register reg) { | 255 void SmiUntag(Register reg) { |
248 sar(reg, kSmiTagSize); | 256 sar(reg, kSmiTagSize); |
249 } | 257 } |
250 | 258 |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 } \ | 746 } \ |
739 masm-> | 747 masm-> |
740 #else | 748 #else |
741 #define ACCESS_MASM(masm) masm-> | 749 #define ACCESS_MASM(masm) masm-> |
742 #endif | 750 #endif |
743 | 751 |
744 | 752 |
745 } } // namespace v8::internal | 753 } } // namespace v8::internal |
746 | 754 |
747 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ | 755 #endif // V8_IA32_MACRO_ASSEMBLER_IA32_H_ |
OLD | NEW |