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 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) { | 1241 void Builtins::Generate_ArrayConstructCode(MacroAssembler* masm) { |
1242 // ----------- S t a t e ------------- | 1242 // ----------- S t a t e ------------- |
1243 // -- eax : argc | 1243 // -- eax : argc |
1244 // -- edi : constructor | 1244 // -- edi : constructor |
1245 // -- esp[0] : return address | 1245 // -- esp[0] : return address |
1246 // -- esp[4] : last argument | 1246 // -- esp[4] : last argument |
1247 // ----------------------------------- | 1247 // ----------------------------------- |
1248 Label generic_constructor; | 1248 Label generic_constructor; |
1249 | 1249 |
1250 if (FLAG_debug_code) { | 1250 if (FLAG_debug_code) { |
1251 // The array construct code is only set for the builtin Array function which | 1251 // The array construct code is only set for the global and natives |
1252 // does always have a map. | 1252 // builtin Array functions which always have maps. |
1253 __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ebx); | 1253 |
1254 __ cmp(edi, Operand(ebx)); | |
1255 __ Assert(equal, "Unexpected Array function"); | |
1256 // Initial map for the builtin Array function should be a map. | 1254 // Initial map for the builtin Array function should be a map. |
1257 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); | 1255 __ mov(ebx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); |
1258 // Will both indicate a NULL and a Smi. | 1256 // Will both indicate a NULL and a Smi. |
1259 __ test(ebx, Immediate(kSmiTagMask)); | 1257 __ test(ebx, Immediate(kSmiTagMask)); |
1260 __ Assert(not_zero, "Unexpected initial map for Array function"); | 1258 __ Assert(not_zero, "Unexpected initial map for Array function"); |
1261 __ CmpObjectType(ebx, MAP_TYPE, ecx); | 1259 __ CmpObjectType(ebx, MAP_TYPE, ecx); |
1262 __ Assert(equal, "Unexpected initial map for Array function"); | 1260 __ Assert(equal, "Unexpected initial map for Array function"); |
1263 } | 1261 } |
1264 | 1262 |
1265 // Run the native code for the Array function called as constructor. | 1263 // Run the native code for the Array function called as constructor. |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); | 1579 Deoptimizer::EntryGenerator generator(masm, Deoptimizer::OSR); |
1582 generator.Generate(); | 1580 generator.Generate(); |
1583 } | 1581 } |
1584 | 1582 |
1585 | 1583 |
1586 #undef __ | 1584 #undef __ |
1587 | 1585 |
1588 } } // namespace v8::internal | 1586 } } // namespace v8::internal |
1589 | 1587 |
1590 #endif // V8_TARGET_ARCH_IA32 | 1588 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |