| 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 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1183 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 1183 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
| 1184 // by calling the runtime system. | 1184 // by calling the runtime system. |
| 1185 __ bind(&slow); | 1185 __ bind(&slow); |
| 1186 __ pop(ebx); // Return address. | 1186 __ pop(ebx); // Return address. |
| 1187 __ push(edx); | 1187 __ push(edx); |
| 1188 __ push(ebx); | 1188 __ push(ebx); |
| 1189 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1189 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
| 1190 } | 1190 } |
| 1191 | 1191 |
| 1192 | 1192 |
| 1193 void ArgumentsAccessStub::GenerateNewNonStrictSlow(MacroAssembler* masm) { | 1193 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
| 1194 // esp[0] : return address | 1194 // esp[0] : return address |
| 1195 // esp[4] : number of parameters | 1195 // esp[4] : number of parameters |
| 1196 // esp[8] : receiver displacement | 1196 // esp[8] : receiver displacement |
| 1197 // esp[12] : function | 1197 // esp[12] : function |
| 1198 | 1198 |
| 1199 // Check if the calling frame is an arguments adaptor frame. | 1199 // Check if the calling frame is an arguments adaptor frame. |
| 1200 Label runtime; | 1200 Label runtime; |
| 1201 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 1201 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 1202 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); | 1202 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); |
| 1203 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1203 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1204 __ j(not_equal, &runtime, Label::kNear); | 1204 __ j(not_equal, &runtime, Label::kNear); |
| 1205 | 1205 |
| 1206 // Patch the arguments.length and the parameters pointer. | 1206 // Patch the arguments.length and the parameters pointer. |
| 1207 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1207 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 1208 __ mov(Operand(esp, 1 * kPointerSize), ecx); | 1208 __ mov(Operand(esp, 1 * kPointerSize), ecx); |
| 1209 __ lea(edx, Operand(edx, ecx, times_2, | 1209 __ lea(edx, Operand(edx, ecx, times_2, |
| 1210 StandardFrameConstants::kCallerSPOffset)); | 1210 StandardFrameConstants::kCallerSPOffset)); |
| 1211 __ mov(Operand(esp, 2 * kPointerSize), edx); | 1211 __ mov(Operand(esp, 2 * kPointerSize), edx); |
| 1212 | 1212 |
| 1213 __ bind(&runtime); | 1213 __ bind(&runtime); |
| 1214 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 1214 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 | 1217 |
| 1218 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { | 1218 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
| 1219 Isolate* isolate = masm->isolate(); | 1219 Isolate* isolate = masm->isolate(); |
| 1220 | 1220 |
| 1221 // esp[0] : return address | 1221 // esp[0] : return address |
| 1222 // esp[4] : number of parameters (tagged) | 1222 // esp[4] : number of parameters (tagged) |
| 1223 // esp[8] : receiver displacement | 1223 // esp[8] : receiver displacement |
| 1224 // esp[12] : function | 1224 // esp[12] : function |
| 1225 | 1225 |
| 1226 // ebx = parameter count (tagged) | 1226 // ebx = parameter count (tagged) |
| 1227 __ mov(ebx, Operand(esp, 1 * kPointerSize)); | 1227 __ mov(ebx, Operand(esp, 1 * kPointerSize)); |
| 1228 | 1228 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 // esp[12] = address of receiver argument | 1342 // esp[12] = address of receiver argument |
| 1343 // Free a register. | 1343 // Free a register. |
| 1344 __ push(eax); | 1344 __ push(eax); |
| 1345 | 1345 |
| 1346 // Initialize parameter map. If there are no mapped arguments, we're done. | 1346 // Initialize parameter map. If there are no mapped arguments, we're done. |
| 1347 Label skip_parameter_map; | 1347 Label skip_parameter_map; |
| 1348 __ test(ebx, ebx); | 1348 __ test(ebx, ebx); |
| 1349 __ j(zero, &skip_parameter_map); | 1349 __ j(zero, &skip_parameter_map); |
| 1350 | 1350 |
| 1351 __ mov(FieldOperand(edi, FixedArray::kMapOffset), | 1351 __ mov(FieldOperand(edi, FixedArray::kMapOffset), |
| 1352 Immediate(isolate->factory()->non_strict_arguments_elements_map())); | 1352 Immediate(isolate->factory()->sloppy_arguments_elements_map())); |
| 1353 __ lea(eax, Operand(ebx, reinterpret_cast<intptr_t>(Smi::FromInt(2)))); | 1353 __ lea(eax, Operand(ebx, reinterpret_cast<intptr_t>(Smi::FromInt(2)))); |
| 1354 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), eax); | 1354 __ mov(FieldOperand(edi, FixedArray::kLengthOffset), eax); |
| 1355 __ mov(FieldOperand(edi, FixedArray::kHeaderSize + 0 * kPointerSize), esi); | 1355 __ mov(FieldOperand(edi, FixedArray::kHeaderSize + 0 * kPointerSize), esi); |
| 1356 __ lea(eax, Operand(edi, ebx, times_2, kParameterMapHeaderSize)); | 1356 __ lea(eax, Operand(edi, ebx, times_2, kParameterMapHeaderSize)); |
| 1357 __ mov(FieldOperand(edi, FixedArray::kHeaderSize + 1 * kPointerSize), eax); | 1357 __ mov(FieldOperand(edi, FixedArray::kHeaderSize + 1 * kPointerSize), eax); |
| 1358 | 1358 |
| 1359 // Copy the parameter slots and the holes in the arguments. | 1359 // Copy the parameter slots and the holes in the arguments. |
| 1360 // We need to fill in mapped_parameter_count slots. They index the context, | 1360 // We need to fill in mapped_parameter_count slots. They index the context, |
| 1361 // where parameters are stored in reverse order, at | 1361 // where parameters are stored in reverse order, at |
| 1362 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1 | 1362 // MIN_CONTEXT_SLOTS .. MIN_CONTEXT_SLOTS+parameter_count-1 |
| (...skipping 4095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5458 Operand(ebp, 7 * kPointerSize), | 5458 Operand(ebp, 7 * kPointerSize), |
| 5459 NULL); | 5459 NULL); |
| 5460 } | 5460 } |
| 5461 | 5461 |
| 5462 | 5462 |
| 5463 #undef __ | 5463 #undef __ |
| 5464 | 5464 |
| 5465 } } // namespace v8::internal | 5465 } } // namespace v8::internal |
| 5466 | 5466 |
| 5467 #endif // V8_TARGET_ARCH_IA32 | 5467 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |