| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Initial map for the builtin Array functions should be maps. | 148 // Initial map for the builtin Array functions should be maps. |
| 149 __ ldr(r2, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset)); | 149 __ ldr(r2, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset)); |
| 150 __ SmiTst(r2); | 150 __ SmiTst(r2); |
| 151 __ Assert(ne, kUnexpectedInitialMapForArrayFunction); | 151 __ Assert(ne, kUnexpectedInitialMapForArrayFunction); |
| 152 __ CompareObjectType(r2, r3, r4, MAP_TYPE); | 152 __ CompareObjectType(r2, r3, r4, MAP_TYPE); |
| 153 __ Assert(eq, kUnexpectedInitialMapForArrayFunction); | 153 __ Assert(eq, kUnexpectedInitialMapForArrayFunction); |
| 154 } | 154 } |
| 155 | 155 |
| 156 // Run the native code for the Array function called as a normal function. | 156 // Run the native code for the Array function called as a normal function. |
| 157 // tail call a stub | 157 // tail call a stub |
| 158 Handle<Object> undefined_sentinel( | 158 Handle<Object> megamorphic_sentinel = |
| 159 masm->isolate()->heap()->undefined_value(), | 159 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()); |
| 160 masm->isolate()); | 160 __ mov(r2, Operand(megamorphic_sentinel)); |
| 161 __ mov(r2, Operand(undefined_sentinel)); | |
| 162 ArrayConstructorStub stub(masm->isolate()); | 161 ArrayConstructorStub stub(masm->isolate()); |
| 163 __ TailCallStub(&stub); | 162 __ TailCallStub(&stub); |
| 164 } | 163 } |
| 165 | 164 |
| 166 | 165 |
| 167 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { | 166 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { |
| 168 // ----------- S t a t e ------------- | 167 // ----------- S t a t e ------------- |
| 169 // -- r0 : number of arguments | 168 // -- r0 : number of arguments |
| 170 // -- r1 : constructor function | 169 // -- r1 : constructor function |
| 171 // -- lr : return address | 170 // -- lr : return address |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 __ mov(r8, Operand(r4)); | 730 __ mov(r8, Operand(r4)); |
| 732 } | 731 } |
| 733 if (kR9Available == 1) { | 732 if (kR9Available == 1) { |
| 734 __ mov(r9, Operand(r4)); | 733 __ mov(r9, Operand(r4)); |
| 735 } | 734 } |
| 736 | 735 |
| 737 // Invoke the code and pass argc as r0. | 736 // Invoke the code and pass argc as r0. |
| 738 __ mov(r0, Operand(r3)); | 737 __ mov(r0, Operand(r3)); |
| 739 if (is_construct) { | 738 if (is_construct) { |
| 740 // No type feedback cell is available | 739 // No type feedback cell is available |
| 741 Handle<Object> undefined_sentinel( | 740 Handle<Object> megamorphic_sentinel = |
| 742 masm->isolate()->heap()->undefined_value(), masm->isolate()); | 741 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()); |
| 743 __ mov(r2, Operand(undefined_sentinel)); | 742 __ mov(r2, Operand(megamorphic_sentinel)); |
| 744 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 743 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
| 745 __ CallStub(&stub); | 744 __ CallStub(&stub); |
| 746 } else { | 745 } else { |
| 747 ParameterCount actual(r0); | 746 ParameterCount actual(r0); |
| 748 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); | 747 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); |
| 749 } | 748 } |
| 750 // Exit the JS frame and remove the parameters (except function), and | 749 // Exit the JS frame and remove the parameters (except function), and |
| 751 // return. | 750 // return. |
| 752 // Respect ABI stack constraint. | 751 // Respect ABI stack constraint. |
| 753 } | 752 } |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 __ bind(&dont_adapt_arguments); | 1467 __ bind(&dont_adapt_arguments); |
| 1469 __ Jump(r3); | 1468 __ Jump(r3); |
| 1470 } | 1469 } |
| 1471 | 1470 |
| 1472 | 1471 |
| 1473 #undef __ | 1472 #undef __ |
| 1474 | 1473 |
| 1475 } } // namespace v8::internal | 1474 } } // namespace v8::internal |
| 1476 | 1475 |
| 1477 #endif // V8_TARGET_ARCH_ARM | 1476 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |