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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) { | 451 void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) { |
452 // ----------- S t a t e ------------- | 452 // ----------- S t a t e ------------- |
453 // -- r0 : number of arguments | 453 // -- r0 : number of arguments |
454 // -- r1 : constructor function | 454 // -- r1 : constructor function |
455 // -- lr : return address | 455 // -- lr : return address |
456 // -- sp[...]: constructor arguments | 456 // -- sp[...]: constructor arguments |
457 // ----------------------------------- | 457 // ----------------------------------- |
458 Label generic_constructor; | 458 Label generic_constructor; |
459 | 459 |
460 if (FLAG_debug_code) { | 460 if (FLAG_debug_code) { |
461 // The array construct code is only set for the builtin Array function which | 461 // The array construct code is only set for the builtin and internal |
462 // always have a map. | 462 // Array functions which always have a map. |
463 GenerateLoadArrayFunction(masm, r2); | |
464 __ cmp(r1, r2); | |
465 __ Assert(eq, "Unexpected Array function"); | |
466 // Initial map for the builtin Array function should be a map. | 463 // Initial map for the builtin Array function should be a map. |
467 __ ldr(r2, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset)); | 464 __ ldr(r2, FieldMemOperand(r1, JSFunction::kPrototypeOrInitialMapOffset)); |
468 __ tst(r2, Operand(kSmiTagMask)); | 465 __ tst(r2, Operand(kSmiTagMask)); |
469 __ Assert(ne, "Unexpected initial map for Array function"); | 466 __ Assert(ne, "Unexpected initial map for Array function"); |
470 __ CompareObjectType(r2, r3, r4, MAP_TYPE); | 467 __ CompareObjectType(r2, r3, r4, MAP_TYPE); |
471 __ Assert(eq, "Unexpected initial map for Array function"); | 468 __ Assert(eq, "Unexpected initial map for Array function"); |
472 } | 469 } |
473 | 470 |
474 // Run the native code for the Array function called as a constructor. | 471 // Run the native code for the Array function called as a constructor. |
475 ArrayNativeCode(masm, &generic_constructor); | 472 ArrayNativeCode(masm, &generic_constructor); |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 __ bind(&dont_adapt_arguments); | 1616 __ bind(&dont_adapt_arguments); |
1620 __ Jump(r3); | 1617 __ Jump(r3); |
1621 } | 1618 } |
1622 | 1619 |
1623 | 1620 |
1624 #undef __ | 1621 #undef __ |
1625 | 1622 |
1626 } } // namespace v8::internal | 1623 } } // namespace v8::internal |
1627 | 1624 |
1628 #endif // V8_TARGET_ARCH_ARM | 1625 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |