OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 if (FLAG_debug_code) { | 142 if (FLAG_debug_code) { |
143 // Initial map for the builtin Array functions should be maps. | 143 // Initial map for the builtin Array functions should be maps. |
144 __ Ldr(x10, FieldMemOperand(x1, JSFunction::kPrototypeOrInitialMapOffset)); | 144 __ Ldr(x10, FieldMemOperand(x1, JSFunction::kPrototypeOrInitialMapOffset)); |
145 __ Tst(x10, kSmiTagMask); | 145 __ Tst(x10, kSmiTagMask); |
146 __ Assert(ne, kUnexpectedInitialMapForArrayFunction); | 146 __ Assert(ne, kUnexpectedInitialMapForArrayFunction); |
147 __ CompareObjectType(x10, x11, x12, MAP_TYPE); | 147 __ CompareObjectType(x10, x11, x12, MAP_TYPE); |
148 __ Assert(eq, kUnexpectedInitialMapForArrayFunction); | 148 __ Assert(eq, kUnexpectedInitialMapForArrayFunction); |
149 } | 149 } |
150 | 150 |
151 // Run the native code for the Array function called as a normal function. | 151 // Run the native code for the Array function called as a normal function. |
152 Handle<Object> undefined_sentinel( | 152 Handle<Object> megamorphic_sentinel = |
153 masm->isolate()->heap()->undefined_value(), | 153 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()); |
154 masm->isolate()); | 154 __ Mov(x2, Operand(megamorphic_sentinel)); |
155 __ Mov(x2, Operand(undefined_sentinel)); | |
156 ArrayConstructorStub stub(masm->isolate()); | 155 ArrayConstructorStub stub(masm->isolate()); |
157 __ TailCallStub(&stub); | 156 __ TailCallStub(&stub); |
158 } | 157 } |
159 | 158 |
160 | 159 |
161 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { | 160 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { |
162 // ----------- S t a t e ------------- | 161 // ----------- S t a t e ------------- |
163 // -- x0 : number of arguments | 162 // -- x0 : number of arguments |
164 // -- x1 : constructor function | 163 // -- x1 : constructor function |
165 // -- lr : return address | 164 // -- lr : return address |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 // x27 : context pointer (cp). | 707 // x27 : context pointer (cp). |
709 // x28 : JS stack pointer (jssp). | 708 // x28 : JS stack pointer (jssp). |
710 // x29 : frame pointer (fp). | 709 // x29 : frame pointer (fp). |
711 | 710 |
712 // TODO(alexandre): Revisit the MAsm function invocation mechanisms. | 711 // TODO(alexandre): Revisit the MAsm function invocation mechanisms. |
713 // Currently there is a mix of statically and dynamically allocated | 712 // Currently there is a mix of statically and dynamically allocated |
714 // registers. | 713 // registers. |
715 __ Mov(x0, argc); | 714 __ Mov(x0, argc); |
716 if (is_construct) { | 715 if (is_construct) { |
717 // No type feedback cell is available. | 716 // No type feedback cell is available. |
718 Handle<Object> undefined_sentinel( | 717 Handle<Object> megamorphic_sentinel = |
719 masm->isolate()->heap()->undefined_value(), masm->isolate()); | 718 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate()); |
720 __ Mov(x2, Operand(undefined_sentinel)); | 719 __ Mov(x2, Operand(megamorphic_sentinel)); |
721 | 720 |
722 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); | 721 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
723 __ CallStub(&stub); | 722 __ CallStub(&stub); |
724 } else { | 723 } else { |
725 ParameterCount actual(x0); | 724 ParameterCount actual(x0); |
726 __ InvokeFunction(function, actual, CALL_FUNCTION, NullCallWrapper()); | 725 __ InvokeFunction(function, actual, CALL_FUNCTION, NullCallWrapper()); |
727 } | 726 } |
728 // Exit the JS internal frame and remove the parameters (except function), | 727 // Exit the JS internal frame and remove the parameters (except function), |
729 // and return. | 728 // and return. |
730 } | 729 } |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 __ Bind(&dont_adapt_arguments); | 1469 __ Bind(&dont_adapt_arguments); |
1471 __ Jump(x3); | 1470 __ Jump(x3); |
1472 } | 1471 } |
1473 | 1472 |
1474 | 1473 |
1475 #undef __ | 1474 #undef __ |
1476 | 1475 |
1477 } } // namespace v8::internal | 1476 } } // namespace v8::internal |
1478 | 1477 |
1479 #endif // V8_TARGET_ARCH_ARM | 1478 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |