| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 | 374 |
| 375 // Generate code to load the length from a string object and return the length. | 375 // Generate code to load the length from a string object and return the length. |
| 376 // If the receiver object is not a string or a wrapped string object the | 376 // If the receiver object is not a string or a wrapped string object the |
| 377 // execution continues at the miss label. The register containing the | 377 // execution continues at the miss label. The register containing the |
| 378 // receiver is potentially clobbered. | 378 // receiver is potentially clobbered. |
| 379 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, | 379 void StubCompiler::GenerateLoadStringLength(MacroAssembler* masm, |
| 380 Register receiver, | 380 Register receiver, |
| 381 Register scratch1, | 381 Register scratch1, |
| 382 Register scratch2, | 382 Register scratch2, |
| 383 Label* miss, | 383 Label* miss) { |
| 384 bool support_wrappers) { | |
| 385 Label check_wrapper; | 384 Label check_wrapper; |
| 386 | 385 |
| 387 // Check if the object is a string leaving the instance type in the | 386 // Check if the object is a string leaving the instance type in the |
| 388 // scratch1 register. | 387 // scratch1 register. |
| 389 GenerateStringCheck(masm, receiver, scratch1, scratch2, miss, | 388 GenerateStringCheck(masm, receiver, scratch1, scratch2, miss, &check_wrapper); |
| 390 support_wrappers ? &check_wrapper : miss); | |
| 391 | 389 |
| 392 // Load length directly from the string. | 390 // Load length directly from the string. |
| 393 __ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset)); | 391 __ ldr(r0, FieldMemOperand(receiver, String::kLengthOffset)); |
| 394 __ Ret(); | 392 __ Ret(); |
| 395 | 393 |
| 396 if (support_wrappers) { | 394 // Check if the object is a JSValue wrapper. |
| 397 // Check if the object is a JSValue wrapper. | 395 __ bind(&check_wrapper); |
| 398 __ bind(&check_wrapper); | 396 __ cmp(scratch1, Operand(JS_VALUE_TYPE)); |
| 399 __ cmp(scratch1, Operand(JS_VALUE_TYPE)); | 397 __ b(ne, miss); |
| 400 __ b(ne, miss); | |
| 401 | 398 |
| 402 // Unwrap the value and check if the wrapped value is a string. | 399 // Unwrap the value and check if the wrapped value is a string. |
| 403 __ ldr(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset)); | 400 __ ldr(scratch1, FieldMemOperand(receiver, JSValue::kValueOffset)); |
| 404 GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss); | 401 GenerateStringCheck(masm, scratch1, scratch2, scratch2, miss, miss); |
| 405 __ ldr(r0, FieldMemOperand(scratch1, String::kLengthOffset)); | 402 __ ldr(r0, FieldMemOperand(scratch1, String::kLengthOffset)); |
| 406 __ Ret(); | 403 __ Ret(); |
| 407 } | |
| 408 } | 404 } |
| 409 | 405 |
| 410 | 406 |
| 411 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, | 407 void StubCompiler::GenerateLoadFunctionPrototype(MacroAssembler* masm, |
| 412 Register receiver, | 408 Register receiver, |
| 413 Register scratch1, | 409 Register scratch1, |
| 414 Register scratch2, | 410 Register scratch2, |
| 415 Label* miss_label) { | 411 Label* miss_label) { |
| 416 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); | 412 __ TryGetFunctionPrototype(receiver, scratch1, scratch2, miss_label); |
| 417 __ mov(r0, scratch1); | 413 __ mov(r0, scratch1); |
| (...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3175 // ----------------------------------- | 3171 // ----------------------------------- |
| 3176 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); | 3172 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); |
| 3177 } | 3173 } |
| 3178 | 3174 |
| 3179 | 3175 |
| 3180 #undef __ | 3176 #undef __ |
| 3181 | 3177 |
| 3182 } } // namespace v8::internal | 3178 } } // namespace v8::internal |
| 3183 | 3179 |
| 3184 #endif // V8_TARGET_ARCH_ARM | 3180 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |