| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 __ bind(&empty_array); | 328 __ bind(&empty_array); |
| 329 AllocateEmptyJSArray(masm, | 329 AllocateEmptyJSArray(masm, |
| 330 a1, | 330 a1, |
| 331 a2, | 331 a2, |
| 332 a3, | 332 a3, |
| 333 t0, | 333 t0, |
| 334 t1, | 334 t1, |
| 335 call_generic_code); | 335 call_generic_code); |
| 336 __ IncrementCounter(counters->array_function_native(), 1, a3, t0); | 336 __ IncrementCounter(counters->array_function_native(), 1, a3, t0); |
| 337 // Set up return value, remove receiver from stack and return. | 337 // Set up return value, remove receiver from stack and return. |
| 338 __ Addu(sp, sp, Operand(kPointerSize)); |
| 339 __ Ret(USE_DELAY_SLOT); |
| 338 __ mov(v0, a2); | 340 __ mov(v0, a2); |
| 339 __ Addu(sp, sp, Operand(kPointerSize)); | |
| 340 __ Ret(); | |
| 341 | 341 |
| 342 // Check for one argument. Bail out if argument is not smi or if it is | 342 // Check for one argument. Bail out if argument is not smi or if it is |
| 343 // negative. | 343 // negative. |
| 344 __ bind(&argc_one_or_more); | 344 __ bind(&argc_one_or_more); |
| 345 __ Branch(&argc_two_or_more, ne, a0, Operand(1)); | 345 __ Branch(&argc_two_or_more, ne, a0, Operand(1)); |
| 346 | 346 |
| 347 STATIC_ASSERT(kSmiTag == 0); | 347 STATIC_ASSERT(kSmiTag == 0); |
| 348 __ lw(a2, MemOperand(sp)); // Get the argument from the stack. | 348 __ lw(a2, MemOperand(sp)); // Get the argument from the stack. |
| 349 __ Branch(¬_empty_array, ne, a2, Operand(zero_reg)); | 349 __ Branch(¬_empty_array, ne, a2, Operand(zero_reg)); |
| 350 __ Drop(1); // Adjust stack. | 350 __ Drop(1); // Adjust stack. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 371 a3, | 371 a3, |
| 372 t0, | 372 t0, |
| 373 t1, | 373 t1, |
| 374 t2, | 374 t2, |
| 375 t3, | 375 t3, |
| 376 true, | 376 true, |
| 377 call_generic_code); | 377 call_generic_code); |
| 378 __ IncrementCounter(counters->array_function_native(), 1, a2, t0); | 378 __ IncrementCounter(counters->array_function_native(), 1, a2, t0); |
| 379 | 379 |
| 380 // Set up return value, remove receiver and argument from stack and return. | 380 // Set up return value, remove receiver and argument from stack and return. |
| 381 __ Addu(sp, sp, Operand(2 * kPointerSize)); |
| 382 __ Ret(USE_DELAY_SLOT); |
| 381 __ mov(v0, a3); | 383 __ mov(v0, a3); |
| 382 __ Addu(sp, sp, Operand(2 * kPointerSize)); | |
| 383 __ Ret(); | |
| 384 | 384 |
| 385 // Handle construction of an array from a list of arguments. | 385 // Handle construction of an array from a list of arguments. |
| 386 __ bind(&argc_two_or_more); | 386 __ bind(&argc_two_or_more); |
| 387 __ sll(a2, a0, kSmiTagSize); // Convert argc to a smi. | 387 __ sll(a2, a0, kSmiTagSize); // Convert argc to a smi. |
| 388 | 388 |
| 389 // a0: argc | 389 // a0: argc |
| 390 // a1: constructor | 390 // a1: constructor |
| 391 // a2: array_size (smi) | 391 // a2: array_size (smi) |
| 392 // sp[0]: last argument | 392 // sp[0]: last argument |
| 393 AllocateJSArray(masm, | 393 AllocateJSArray(masm, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 | 427 |
| 428 __ bind(&finish); | 428 __ bind(&finish); |
| 429 __ mov(sp, t3); | 429 __ mov(sp, t3); |
| 430 | 430 |
| 431 // Remove caller arguments and receiver from the stack, setup return value and | 431 // Remove caller arguments and receiver from the stack, setup return value and |
| 432 // return. | 432 // return. |
| 433 // a0: argc | 433 // a0: argc |
| 434 // a3: JSArray | 434 // a3: JSArray |
| 435 // sp[0]: receiver | 435 // sp[0]: receiver |
| 436 __ Addu(sp, sp, Operand(kPointerSize)); | 436 __ Addu(sp, sp, Operand(kPointerSize)); |
| 437 __ Ret(USE_DELAY_SLOT); |
| 437 __ mov(v0, a3); | 438 __ mov(v0, a3); |
| 438 __ Ret(); | |
| 439 | 439 |
| 440 __ bind(&has_non_smi_element); | 440 __ bind(&has_non_smi_element); |
| 441 // Double values are handled by the runtime. | 441 // Double values are handled by the runtime. |
| 442 __ CheckMap( | 442 __ CheckMap( |
| 443 a2, t5, Heap::kHeapNumberMapRootIndex, ¬_double, DONT_DO_SMI_CHECK); | 443 a2, t5, Heap::kHeapNumberMapRootIndex, ¬_double, DONT_DO_SMI_CHECK); |
| 444 __ bind(&cant_transition_map); | 444 __ bind(&cant_transition_map); |
| 445 __ UndoAllocationInNewSpace(a3, t0); | 445 __ UndoAllocationInNewSpace(a3, t0); |
| 446 __ Branch(call_generic_code); | 446 __ Branch(call_generic_code); |
| 447 | 447 |
| 448 __ bind(¬_double); | 448 __ bind(¬_double); |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1365 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); | 1365 __ CallRuntime(Runtime::kNotifyDeoptimized, 1); |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 // Get the full codegen state from the stack and untag it -> t2. | 1368 // Get the full codegen state from the stack and untag it -> t2. |
| 1369 __ lw(t2, MemOperand(sp, 0 * kPointerSize)); | 1369 __ lw(t2, MemOperand(sp, 0 * kPointerSize)); |
| 1370 __ SmiUntag(t2); | 1370 __ SmiUntag(t2); |
| 1371 // Switch on the state. | 1371 // Switch on the state. |
| 1372 Label with_tos_register, unknown_state; | 1372 Label with_tos_register, unknown_state; |
| 1373 __ Branch(&with_tos_register, | 1373 __ Branch(&with_tos_register, |
| 1374 ne, t2, Operand(FullCodeGenerator::NO_REGISTERS)); | 1374 ne, t2, Operand(FullCodeGenerator::NO_REGISTERS)); |
| 1375 __ Ret(USE_DELAY_SLOT); |
| 1376 // Safe to fill delay slot Addu will emit one instruction. |
| 1375 __ Addu(sp, sp, Operand(1 * kPointerSize)); // Remove state. | 1377 __ Addu(sp, sp, Operand(1 * kPointerSize)); // Remove state. |
| 1376 __ Ret(); | |
| 1377 | 1378 |
| 1378 __ bind(&with_tos_register); | 1379 __ bind(&with_tos_register); |
| 1379 __ lw(v0, MemOperand(sp, 1 * kPointerSize)); | 1380 __ lw(v0, MemOperand(sp, 1 * kPointerSize)); |
| 1380 __ Branch(&unknown_state, ne, t2, Operand(FullCodeGenerator::TOS_REG)); | 1381 __ Branch(&unknown_state, ne, t2, Operand(FullCodeGenerator::TOS_REG)); |
| 1381 | 1382 |
| 1383 __ Ret(USE_DELAY_SLOT); |
| 1384 // Safe to fill delay slot Addu will emit one instruction. |
| 1382 __ Addu(sp, sp, Operand(2 * kPointerSize)); // Remove state. | 1385 __ Addu(sp, sp, Operand(2 * kPointerSize)); // Remove state. |
| 1383 __ Ret(); | |
| 1384 | 1386 |
| 1385 __ bind(&unknown_state); | 1387 __ bind(&unknown_state); |
| 1386 __ stop("no cases left"); | 1388 __ stop("no cases left"); |
| 1387 } | 1389 } |
| 1388 | 1390 |
| 1389 | 1391 |
| 1390 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { | 1392 void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) { |
| 1391 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); | 1393 Generate_NotifyDeoptimizedHelper(masm, Deoptimizer::EAGER); |
| 1392 } | 1394 } |
| 1393 | 1395 |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 __ bind(&dont_adapt_arguments); | 1937 __ bind(&dont_adapt_arguments); |
| 1936 __ Jump(a3); | 1938 __ Jump(a3); |
| 1937 } | 1939 } |
| 1938 | 1940 |
| 1939 | 1941 |
| 1940 #undef __ | 1942 #undef __ |
| 1941 | 1943 |
| 1942 } } // namespace v8::internal | 1944 } } // namespace v8::internal |
| 1943 | 1945 |
| 1944 #endif // V8_TARGET_ARCH_MIPS | 1946 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |