| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // Check if the object is a string leaving the instance type in the | 320 // Check if the object is a string leaving the instance type in the |
| 321 // scratch register. | 321 // scratch register. |
| 322 GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper); | 322 GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper); |
| 323 | 323 |
| 324 // Load length directly from the string. | 324 // Load length directly from the string. |
| 325 __ bind(&load_length); | 325 __ bind(&load_length); |
| 326 __ and_(scratch, Immediate(kStringSizeMask)); | 326 __ and_(scratch, Immediate(kStringSizeMask)); |
| 327 __ movl(rax, FieldOperand(receiver, String::kLengthOffset)); | 327 __ movl(rax, FieldOperand(receiver, String::kLengthOffset)); |
| 328 // rcx is also the receiver. | 328 // rcx is also the receiver. |
| 329 __ lea(rcx, Operand(scratch, String::kLongLengthShift)); | 329 __ lea(rcx, Operand(scratch, String::kLongLengthShift)); |
| 330 __ shr(rax); // rcx is implicit shift register. | 330 __ shr_cl(rax); |
| 331 __ Integer32ToSmi(rax, rax); | 331 __ Integer32ToSmi(rax, rax); |
| 332 __ ret(0); | 332 __ ret(0); |
| 333 | 333 |
| 334 // Check if the object is a JSValue wrapper. | 334 // Check if the object is a JSValue wrapper. |
| 335 __ bind(&check_wrapper); | 335 __ bind(&check_wrapper); |
| 336 __ cmpl(scratch, Immediate(JS_VALUE_TYPE)); | 336 __ cmpl(scratch, Immediate(JS_VALUE_TYPE)); |
| 337 __ j(not_equal, miss); | 337 __ j(not_equal, miss); |
| 338 | 338 |
| 339 // Check if the wrapped value is a string and load the length | 339 // Check if the wrapped value is a string and load the length |
| 340 // directly if it is. | 340 // directly if it is. |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1856 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 1857 | 1857 |
| 1858 // Return the generated code. | 1858 // Return the generated code. |
| 1859 return GetCode(); | 1859 return GetCode(); |
| 1860 } | 1860 } |
| 1861 | 1861 |
| 1862 | 1862 |
| 1863 #undef __ | 1863 #undef __ |
| 1864 | 1864 |
| 1865 } } // namespace v8::internal | 1865 } } // namespace v8::internal |
| OLD | NEW |