| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 __ JumpIfSmi(object, slow_case); | 420 __ JumpIfSmi(object, slow_case); |
| 421 // Check that the object is some kind of JSObject. | 421 // Check that the object is some kind of JSObject. |
| 422 __ CompareObjectType(object, scratch1, scratch2, FIRST_JS_RECEIVER_TYPE); | 422 __ CompareObjectType(object, scratch1, scratch2, FIRST_JS_RECEIVER_TYPE); |
| 423 __ b(lt, slow_case); | 423 __ b(lt, slow_case); |
| 424 | 424 |
| 425 // Check that the key is a positive smi. | 425 // Check that the key is a positive smi. |
| 426 __ tst(key, Operand(0x80000001)); | 426 __ tst(key, Operand(0x80000001)); |
| 427 __ b(ne, slow_case); | 427 __ b(ne, slow_case); |
| 428 | 428 |
| 429 // Load the elements into scratch1 and check its map. | 429 // Load the elements into scratch1 and check its map. |
| 430 Handle<Map> arguments_map(heap->non_strict_arguments_elements_map()); | 430 Handle<Map> arguments_map(heap->sloppy_arguments_elements_map()); |
| 431 __ ldr(scratch1, FieldMemOperand(object, JSObject::kElementsOffset)); | 431 __ ldr(scratch1, FieldMemOperand(object, JSObject::kElementsOffset)); |
| 432 __ CheckMap(scratch1, scratch2, arguments_map, slow_case, DONT_DO_SMI_CHECK); | 432 __ CheckMap(scratch1, scratch2, arguments_map, slow_case, DONT_DO_SMI_CHECK); |
| 433 | 433 |
| 434 // Check if element is in the range of mapped arguments. If not, jump | 434 // Check if element is in the range of mapped arguments. If not, jump |
| 435 // to the unmapped lookup with the parameter map in scratch1. | 435 // to the unmapped lookup with the parameter map in scratch1. |
| 436 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); | 436 __ ldr(scratch2, FieldMemOperand(scratch1, FixedArray::kLengthOffset)); |
| 437 __ sub(scratch2, scratch2, Operand(Smi::FromInt(2))); | 437 __ sub(scratch2, scratch2, Operand(Smi::FromInt(2))); |
| 438 __ cmp(key, Operand(scratch2)); | 438 __ cmp(key, Operand(scratch2)); |
| 439 __ b(cs, unmapped_case); | 439 __ b(cs, unmapped_case); |
| 440 | 440 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 __ b(cs, slow_case); | 482 __ b(cs, slow_case); |
| 483 __ mov(scratch, Operand(kPointerSize >> 1)); | 483 __ mov(scratch, Operand(kPointerSize >> 1)); |
| 484 __ mul(scratch, key, scratch); | 484 __ mul(scratch, key, scratch); |
| 485 __ add(scratch, | 485 __ add(scratch, |
| 486 scratch, | 486 scratch, |
| 487 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 487 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
| 488 return MemOperand(backing_store, scratch); | 488 return MemOperand(backing_store, scratch); |
| 489 } | 489 } |
| 490 | 490 |
| 491 | 491 |
| 492 void KeyedLoadIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 492 void KeyedLoadIC::GenerateSloppyArguments(MacroAssembler* masm) { |
| 493 // ---------- S t a t e -------------- | 493 // ---------- S t a t e -------------- |
| 494 // -- lr : return address | 494 // -- lr : return address |
| 495 // -- r0 : key | 495 // -- r0 : key |
| 496 // -- r1 : receiver | 496 // -- r1 : receiver |
| 497 // ----------------------------------- | 497 // ----------------------------------- |
| 498 Label slow, notin; | 498 Label slow, notin; |
| 499 MemOperand mapped_location = | 499 MemOperand mapped_location = |
| 500 GenerateMappedArgumentsLookup(masm, r1, r0, r2, r3, r4, ¬in, &slow); | 500 GenerateMappedArgumentsLookup(masm, r1, r0, r2, r3, r4, ¬in, &slow); |
| 501 __ ldr(r0, mapped_location); | 501 __ ldr(r0, mapped_location); |
| 502 __ Ret(); | 502 __ Ret(); |
| 503 __ bind(¬in); | 503 __ bind(¬in); |
| 504 // The unmapped lookup expects that the parameter map is in r2. | 504 // The unmapped lookup expects that the parameter map is in r2. |
| 505 MemOperand unmapped_location = | 505 MemOperand unmapped_location = |
| 506 GenerateUnmappedArgumentsLookup(masm, r0, r2, r3, &slow); | 506 GenerateUnmappedArgumentsLookup(masm, r0, r2, r3, &slow); |
| 507 __ ldr(r2, unmapped_location); | 507 __ ldr(r2, unmapped_location); |
| 508 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 508 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
| 509 __ cmp(r2, r3); | 509 __ cmp(r2, r3); |
| 510 __ b(eq, &slow); | 510 __ b(eq, &slow); |
| 511 __ mov(r0, r2); | 511 __ mov(r0, r2); |
| 512 __ Ret(); | 512 __ Ret(); |
| 513 __ bind(&slow); | 513 __ bind(&slow); |
| 514 GenerateMiss(masm); | 514 GenerateMiss(masm); |
| 515 } | 515 } |
| 516 | 516 |
| 517 | 517 |
| 518 void KeyedStoreIC::GenerateNonStrictArguments(MacroAssembler* masm) { | 518 void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) { |
| 519 // ---------- S t a t e -------------- | 519 // ---------- S t a t e -------------- |
| 520 // -- r0 : value | 520 // -- r0 : value |
| 521 // -- r1 : key | 521 // -- r1 : key |
| 522 // -- r2 : receiver | 522 // -- r2 : receiver |
| 523 // -- lr : return address | 523 // -- lr : return address |
| 524 // ----------------------------------- | 524 // ----------------------------------- |
| 525 Label slow, notin; | 525 Label slow, notin; |
| 526 MemOperand mapped_location = | 526 MemOperand mapped_location = |
| 527 GenerateMappedArgumentsLookup(masm, r2, r1, r3, r4, r5, ¬in, &slow); | 527 GenerateMappedArgumentsLookup(masm, r2, r1, r3, r4, r5, ¬in, &slow); |
| 528 __ str(r0, mapped_location); | 528 __ str(r0, mapped_location); |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 } else { | 1331 } else { |
| 1332 ASSERT(Assembler::GetCondition(branch_instr) == ne); | 1332 ASSERT(Assembler::GetCondition(branch_instr) == ne); |
| 1333 patcher.EmitCondition(eq); | 1333 patcher.EmitCondition(eq); |
| 1334 } | 1334 } |
| 1335 } | 1335 } |
| 1336 | 1336 |
| 1337 | 1337 |
| 1338 } } // namespace v8::internal | 1338 } } // namespace v8::internal |
| 1339 | 1339 |
| 1340 #endif // V8_TARGET_ARCH_ARM | 1340 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |