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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 Register scratch2, | 222 Register scratch2, |
223 Label* miss) { | 223 Label* miss) { |
224 Label check_wrapper; | 224 Label check_wrapper; |
225 | 225 |
226 // Check if the object is a string leaving the instance type in the | 226 // Check if the object is a string leaving the instance type in the |
227 // scratch1 register. | 227 // scratch1 register. |
228 GenerateStringCheck(masm, receiver, scratch1, scratch2, miss, &check_wrapper); | 228 GenerateStringCheck(masm, receiver, scratch1, scratch2, miss, &check_wrapper); |
229 | 229 |
230 // Load length directly from the string. | 230 // Load length directly from the string. |
231 __ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset)); | 231 __ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset)); |
| 232 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
232 __ Ret(); | 233 __ Ret(); |
233 | 234 |
234 // Check if the object is a JSValue wrapper. | 235 // Check if the object is a JSValue wrapper. |
235 __ bind(&check_wrapper); | 236 __ bind(&check_wrapper); |
236 __ cmp(scratch1, Operand(JS_VALUE_TYPE)); | 237 __ cmp(scratch1, Operand(JS_VALUE_TYPE)); |
237 __ b(ne, miss); | 238 __ b(ne, miss); |
238 | 239 |
239 // Unwrap the value and check if the wrapped value is a string. | 240 // Unwrap the value and check if the wrapped value is a string. |
240 __ ldr(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset)); | 241 __ ldr(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset)); |
241 GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss); | 242 GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss); |
242 __ ldr(r0, FieldMemOperand(scratch1, String::kLengthOffset)); | 243 __ ldr(r0, FieldMemOperand(scratch1, String::kLengthOffset)); |
| 244 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
243 __ Ret(); | 245 __ Ret(); |
244 } | 246 } |
245 | 247 |
246 | 248 |
247 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, | 249 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, |
248 Register receiver, | 250 Register receiver, |
249 Register scratch1, | 251 Register scratch1, |
250 Register scratch2, | 252 Register scratch2, |
251 Label* miss_label) { | 253 Label* miss_label) { |
252 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); | 254 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1946 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
1945 | 1947 |
1946 // Return the generated code. | 1948 // Return the generated code. |
1947 return GetCode(); | 1949 return GetCode(); |
1948 } | 1950 } |
1949 | 1951 |
1950 | 1952 |
1951 #undef __ | 1953 #undef __ |
1952 | 1954 |
1953 } } // namespace v8::internal | 1955 } } // namespace v8::internal |
OLD | NEW |