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> megamorphic_sentinel = | 158 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
159 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()); | |
160 __ mov(r2, Operand(megamorphic_sentinel)); | |
161 ArrayConstructorStub stub(masm->isolate()); | 159 ArrayConstructorStub stub(masm->isolate()); |
162 __ TailCallStub(&stub); | 160 __ TailCallStub(&stub); |
163 } | 161 } |
164 | 162 |
165 | 163 |
166 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { | 164 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { |
167 // ----------- S t a t e ------------- | 165 // ----------- S t a t e ------------- |
168 // -- r0 : number of arguments | 166 // -- r0 : number of arguments |
169 // -- r1 : constructor function | 167 // -- r1 : constructor function |
170 // -- lr : return address | 168 // -- lr : return address |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 __ mov(r8, Operand(r4)); | 728 __ mov(r8, Operand(r4)); |
731 } | 729 } |
732 if (kR9Available == 1) { | 730 if (kR9Available == 1) { |
733 __ mov(r9, Operand(r4)); | 731 __ mov(r9, Operand(r4)); |
734 } | 732 } |
735 | 733 |
736 // Invoke the code and pass argc as r0. | 734 // Invoke the code and pass argc as r0. |
737 __ mov(r0, Operand(r3)); | 735 __ mov(r0, Operand(r3)); |
738 if (is_construct) { | 736 if (is_construct) { |
739 // No type feedback cell is available | 737 // No type feedback cell is available |
740 Handle<Object> megamorphic_sentinel = | 738 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
741 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()); | |
742 __ mov(r2, Operand(megamorphic_sentinel)); | |
743 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 739 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
744 __ CallStub(&stub); | 740 __ CallStub(&stub); |
745 } else { | 741 } else { |
746 ParameterCount actual(r0); | 742 ParameterCount actual(r0); |
747 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); | 743 __ InvokeFunction(r1, actual, CALL_FUNCTION, NullCallWrapper()); |
748 } | 744 } |
749 // Exit the JS frame and remove the parameters (except function), and | 745 // Exit the JS frame and remove the parameters (except function), and |
750 // return. | 746 // return. |
751 // Respect ABI stack constraint. | 747 // Respect ABI stack constraint. |
752 } | 748 } |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 __ bind(&dont_adapt_arguments); | 1469 __ bind(&dont_adapt_arguments); |
1474 __ Jump(r3); | 1470 __ Jump(r3); |
1475 } | 1471 } |
1476 | 1472 |
1477 | 1473 |
1478 #undef __ | 1474 #undef __ |
1479 | 1475 |
1480 } } // namespace v8::internal | 1476 } } // namespace v8::internal |
1481 | 1477 |
1482 #endif // V8_TARGET_ARCH_ARM | 1478 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |