| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 STATIC_ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); | 1549 STATIC_ASSERT(JS_FUNCTION_TYPE == LAST_JS_OBJECT_TYPE + 1); |
| 1550 __ CompareObjectType(receiver_reg, r2, r3, FIRST_JS_OBJECT_TYPE); | 1550 __ CompareObjectType(receiver_reg, r2, r3, FIRST_JS_OBJECT_TYPE); |
| 1551 __ b(lt, &build_args); | 1551 __ b(lt, &build_args); |
| 1552 | 1552 |
| 1553 // Check that applicand.apply is Function.prototype.apply. | 1553 // Check that applicand.apply is Function.prototype.apply. |
| 1554 __ ldr(r0, MemOperand(sp, kPointerSize)); | 1554 __ ldr(r0, MemOperand(sp, kPointerSize)); |
| 1555 __ BranchOnSmi(r0, &build_args); | 1555 __ BranchOnSmi(r0, &build_args); |
| 1556 __ CompareObjectType(r0, r1, r2, JS_FUNCTION_TYPE); | 1556 __ CompareObjectType(r0, r1, r2, JS_FUNCTION_TYPE); |
| 1557 __ b(ne, &build_args); | 1557 __ b(ne, &build_args); |
| 1558 Handle<Code> apply_code(Builtins::builtin(Builtins::FunctionApply)); | 1558 Handle<Code> apply_code(Builtins::builtin(Builtins::FunctionApply)); |
| 1559 __ ldr(r1, FieldMemOperand(r0, JSFunction::kCodeOffset)); | 1559 __ ldr(r1, FieldMemOperand(r0, JSFunction::kCodeEntryOffset)); |
| 1560 __ sub(r1, r1, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1560 __ cmp(r1, Operand(apply_code)); | 1561 __ cmp(r1, Operand(apply_code)); |
| 1561 __ b(ne, &build_args); | 1562 __ b(ne, &build_args); |
| 1562 | 1563 |
| 1563 // Check that applicand is a function. | 1564 // Check that applicand is a function. |
| 1564 __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); | 1565 __ ldr(r1, MemOperand(sp, 2 * kPointerSize)); |
| 1565 __ BranchOnSmi(r1, &build_args); | 1566 __ BranchOnSmi(r1, &build_args); |
| 1566 __ CompareObjectType(r1, r2, r3, JS_FUNCTION_TYPE); | 1567 __ CompareObjectType(r1, r2, r3, JS_FUNCTION_TYPE); |
| 1567 __ b(ne, &build_args); | 1568 __ b(ne, &build_args); |
| 1568 | 1569 |
| 1569 // Copy the arguments to this function possibly from the | 1570 // Copy the arguments to this function possibly from the |
| (...skipping 5451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7021 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset)); | 7022 __ str(r1, FieldMemOperand(r0, JSObject::kPropertiesOffset)); |
| 7022 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset)); | 7023 __ str(r1, FieldMemOperand(r0, JSObject::kElementsOffset)); |
| 7023 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset)); | 7024 __ str(r2, FieldMemOperand(r0, JSFunction::kPrototypeOrInitialMapOffset)); |
| 7024 __ str(r3, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset)); | 7025 __ str(r3, FieldMemOperand(r0, JSFunction::kSharedFunctionInfoOffset)); |
| 7025 __ str(cp, FieldMemOperand(r0, JSFunction::kContextOffset)); | 7026 __ str(cp, FieldMemOperand(r0, JSFunction::kContextOffset)); |
| 7026 __ str(r1, FieldMemOperand(r0, JSFunction::kLiteralsOffset)); | 7027 __ str(r1, FieldMemOperand(r0, JSFunction::kLiteralsOffset)); |
| 7027 | 7028 |
| 7028 // Initialize the code pointer in the function to be the one | 7029 // Initialize the code pointer in the function to be the one |
| 7029 // found in the shared function info object. | 7030 // found in the shared function info object. |
| 7030 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); | 7031 __ ldr(r3, FieldMemOperand(r3, SharedFunctionInfo::kCodeOffset)); |
| 7031 __ str(r3, FieldMemOperand(r0, JSFunction::kCodeOffset)); | 7032 __ add(r3, r3, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 7033 __ str(r3, FieldMemOperand(r0, JSFunction::kCodeEntryOffset)); |
| 7032 | 7034 |
| 7033 // Return result. The argument function info has been popped already. | 7035 // Return result. The argument function info has been popped already. |
| 7034 __ Ret(); | 7036 __ Ret(); |
| 7035 | 7037 |
| 7036 // Create a new closure through the slower runtime call. | 7038 // Create a new closure through the slower runtime call. |
| 7037 __ bind(&gc); | 7039 __ bind(&gc); |
| 7038 __ Push(cp, r3); | 7040 __ Push(cp, r3); |
| 7039 __ TailCallRuntime(Runtime::kNewClosure, 2, 1); | 7041 __ TailCallRuntime(Runtime::kNewClosure, 2, 1); |
| 7040 } | 7042 } |
| 7041 | 7043 |
| (...skipping 4656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11698 __ bind(&string_add_runtime); | 11700 __ bind(&string_add_runtime); |
| 11699 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 11701 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
| 11700 } | 11702 } |
| 11701 | 11703 |
| 11702 | 11704 |
| 11703 #undef __ | 11705 #undef __ |
| 11704 | 11706 |
| 11705 } } // namespace v8::internal | 11707 } } // namespace v8::internal |
| 11706 | 11708 |
| 11707 #endif // V8_TARGET_ARCH_ARM | 11709 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |