| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // Check if the object is a string leaving the instance type in the | 233 // Check if the object is a string leaving the instance type in the |
| 234 // scratch register. | 234 // scratch register. |
| 235 GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper); | 235 GenerateStringCheck(masm, receiver, scratch, miss, &check_wrapper); |
| 236 | 236 |
| 237 // Load length directly from the string. | 237 // Load length directly from the string. |
| 238 __ bind(&load_length); | 238 __ bind(&load_length); |
| 239 __ and_(scratch, kStringSizeMask); | 239 __ and_(scratch, kStringSizeMask); |
| 240 __ mov(eax, FieldOperand(receiver, String::kLengthOffset)); | 240 __ mov(eax, FieldOperand(receiver, String::kLengthOffset)); |
| 241 // ecx is also the receiver. | 241 // ecx is also the receiver. |
| 242 __ lea(ecx, Operand(scratch, String::kLongLengthShift)); | 242 __ lea(ecx, Operand(scratch, String::kLongLengthShift)); |
| 243 __ shr(eax); // ecx is implicit shift register. | 243 __ shr_cl(eax); |
| 244 __ shl(eax, kSmiTagSize); | 244 __ shl(eax, kSmiTagSize); |
| 245 __ ret(0); | 245 __ ret(0); |
| 246 | 246 |
| 247 // Check if the object is a JSValue wrapper. | 247 // Check if the object is a JSValue wrapper. |
| 248 __ bind(&check_wrapper); | 248 __ bind(&check_wrapper); |
| 249 __ cmp(scratch, JS_VALUE_TYPE); | 249 __ cmp(scratch, JS_VALUE_TYPE); |
| 250 __ j(not_equal, miss, not_taken); | 250 __ j(not_equal, miss, not_taken); |
| 251 | 251 |
| 252 // Check if the wrapped value is a string and load the length | 252 // Check if the wrapped value is a string and load the length |
| 253 // directly if it is. | 253 // directly if it is. |
| (...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); | 1887 __ jmp(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 1888 | 1888 |
| 1889 // Return the generated code. | 1889 // Return the generated code. |
| 1890 return GetCode(); | 1890 return GetCode(); |
| 1891 } | 1891 } |
| 1892 | 1892 |
| 1893 | 1893 |
| 1894 #undef __ | 1894 #undef __ |
| 1895 | 1895 |
| 1896 } } // namespace v8::internal | 1896 } } // namespace v8::internal |
| OLD | NEW |