OLD | NEW |
---|---|
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1883 // sp[0] : index | 1883 // sp[0] : index |
1884 // sp[1] : array/enum cache length | 1884 // sp[1] : array/enum cache length |
1885 // sp[2] : array or enum cache | 1885 // sp[2] : array or enum cache |
1886 // sp[3] : 0 or map | 1886 // sp[3] : 0 or map |
1887 // sp[4] : enumerable | 1887 // sp[4] : enumerable |
1888 // Grab the current frame's height for the break and continue | 1888 // Grab the current frame's height for the break and continue |
1889 // targets only after all the state is pushed on the frame. | 1889 // targets only after all the state is pushed on the frame. |
1890 node->break_target()->set_direction(JumpTarget::FORWARD_ONLY); | 1890 node->break_target()->set_direction(JumpTarget::FORWARD_ONLY); |
1891 node->continue_target()->set_direction(JumpTarget::FORWARD_ONLY); | 1891 node->continue_target()->set_direction(JumpTarget::FORWARD_ONLY); |
1892 | 1892 |
1893 __ ldr(r0, frame_->ElementAt(0)); // load the current count | 1893 // load the current count to r0, load the length to r1 |
Erik Corry
2010/05/04 07:06:13
When we are reformatting comments we should take t
zhangk
2010/05/07 05:32:14
On 2010/05/04 07:06:13, Erik Corry wrote:
Done.
| |
1894 __ ldr(r1, frame_->ElementAt(1)); // load the length | 1894 __ ldrd(r0, frame_->ElementAt(0)); |
1895 __ cmp(r0, Operand(r1)); // compare to the array length | 1895 __ cmp(r0, Operand(r1)); // compare to the array length |
1896 node->break_target()->Branch(hs); | 1896 node->break_target()->Branch(hs); |
1897 | 1897 |
1898 __ ldr(r0, frame_->ElementAt(0)); | 1898 __ ldr(r0, frame_->ElementAt(0)); |
1899 | 1899 |
1900 // Get the i'th entry of the array. | 1900 // Get the i'th entry of the array. |
1901 __ ldr(r2, frame_->ElementAt(2)); | 1901 __ ldr(r2, frame_->ElementAt(2)); |
1902 __ add(r2, r2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 1902 __ add(r2, r2, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
1903 __ ldr(r3, MemOperand(r2, r0, LSL, kPointerSizeLog2 - kSmiTagSize)); | 1903 __ ldr(r3, MemOperand(r2, r0, LSL, kPointerSizeLog2 - kSmiTagSize)); |
1904 | 1904 |
(...skipping 3457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5362 if (mode == OVERWRITE_RIGHT) { | 5362 if (mode == OVERWRITE_RIGHT) { |
5363 __ mov(r5, Operand(r0)); // Overwrite this heap number. | 5363 __ mov(r5, Operand(r0)); // Overwrite this heap number. |
5364 } | 5364 } |
5365 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { | 5365 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { |
5366 CpuFeatures::Scope scope(VFP3); | 5366 CpuFeatures::Scope scope(VFP3); |
5367 // Load the double from tagged HeapNumber r0 to d7. | 5367 // Load the double from tagged HeapNumber r0 to d7. |
5368 __ sub(r7, r0, Operand(kHeapObjectTag)); | 5368 __ sub(r7, r0, Operand(kHeapObjectTag)); |
5369 __ vldr(d7, r7, HeapNumber::kValueOffset); | 5369 __ vldr(d7, r7, HeapNumber::kValueOffset); |
5370 } else { | 5370 } else { |
5371 // Calling convention says that second double is in r2 and r3. | 5371 // Calling convention says that second double is in r2 and r3. |
5372 __ ldr(r2, FieldMemOperand(r0, HeapNumber::kValueOffset)); | 5372 __ ldrd(r2, FieldMemOperand(r0, HeapNumber::kValueOffset)); |
5373 __ ldr(r3, FieldMemOperand(r0, HeapNumber::kValueOffset + 4)); | |
5374 } | 5373 } |
5375 __ jmp(&finished_loading_r0); | 5374 __ jmp(&finished_loading_r0); |
5376 __ bind(&r0_is_smi); | 5375 __ bind(&r0_is_smi); |
5377 if (mode == OVERWRITE_RIGHT) { | 5376 if (mode == OVERWRITE_RIGHT) { |
5378 // We can't overwrite a Smi so get address of new heap number into r5. | 5377 // We can't overwrite a Smi so get address of new heap number into r5. |
5379 AllocateHeapNumber(masm, &slow, r5, r6, r7); | 5378 AllocateHeapNumber(masm, &slow, r5, r6, r7); |
5380 } | 5379 } |
5381 | 5380 |
5382 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { | 5381 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { |
5383 CpuFeatures::Scope scope(VFP3); | 5382 CpuFeatures::Scope scope(VFP3); |
(...skipping 20 matching lines...) Expand all Loading... | |
5404 if (mode == OVERWRITE_LEFT) { | 5403 if (mode == OVERWRITE_LEFT) { |
5405 __ mov(r5, Operand(r1)); // Overwrite this heap number. | 5404 __ mov(r5, Operand(r1)); // Overwrite this heap number. |
5406 } | 5405 } |
5407 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { | 5406 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { |
5408 CpuFeatures::Scope scope(VFP3); | 5407 CpuFeatures::Scope scope(VFP3); |
5409 // Load the double from tagged HeapNumber r1 to d6. | 5408 // Load the double from tagged HeapNumber r1 to d6. |
5410 __ sub(r7, r1, Operand(kHeapObjectTag)); | 5409 __ sub(r7, r1, Operand(kHeapObjectTag)); |
5411 __ vldr(d6, r7, HeapNumber::kValueOffset); | 5410 __ vldr(d6, r7, HeapNumber::kValueOffset); |
5412 } else { | 5411 } else { |
5413 // Calling convention says that first double is in r0 and r1. | 5412 // Calling convention says that first double is in r0 and r1. |
5414 __ ldr(r0, FieldMemOperand(r1, HeapNumber::kValueOffset)); | 5413 __ ldrd(r0, FieldMemOperand(r1, HeapNumber::kValueOffset)); |
5415 __ ldr(r1, FieldMemOperand(r1, HeapNumber::kValueOffset + 4)); | |
5416 } | 5414 } |
5417 __ jmp(&finished_loading_r1); | 5415 __ jmp(&finished_loading_r1); |
5418 __ bind(&r1_is_smi); | 5416 __ bind(&r1_is_smi); |
5419 if (mode == OVERWRITE_LEFT) { | 5417 if (mode == OVERWRITE_LEFT) { |
5420 // We can't overwrite a Smi so get address of new heap number into r5. | 5418 // We can't overwrite a Smi so get address of new heap number into r5. |
5421 AllocateHeapNumber(masm, &slow, r5, r6, r7); | 5419 AllocateHeapNumber(masm, &slow, r5, r6, r7); |
5422 } | 5420 } |
5423 | 5421 |
5424 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { | 5422 if (CpuFeatures::IsSupported(VFP3) && Token::MOD != operation) { |
5425 CpuFeatures::Scope scope(VFP3); | 5423 CpuFeatures::Scope scope(VFP3); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5486 __ pop(r4, eq); // Conditional pop instruction to get rid of alignment push. | 5484 __ pop(r4, eq); // Conditional pop instruction to get rid of alignment push. |
5487 // Store answer in the overwritable heap number. | 5485 // Store answer in the overwritable heap number. |
5488 #if !defined(USE_ARM_EABI) | 5486 #if !defined(USE_ARM_EABI) |
5489 // Double returned in fp coprocessor register 0 and 1, encoded as register | 5487 // Double returned in fp coprocessor register 0 and 1, encoded as register |
5490 // cr8. Offsets must be divisible by 4 for coprocessor so we need to | 5488 // cr8. Offsets must be divisible by 4 for coprocessor so we need to |
5491 // substract the tag from r4. | 5489 // substract the tag from r4. |
5492 __ sub(r5, r4, Operand(kHeapObjectTag)); | 5490 __ sub(r5, r4, Operand(kHeapObjectTag)); |
5493 __ stc(p1, cr8, MemOperand(r5, HeapNumber::kValueOffset)); | 5491 __ stc(p1, cr8, MemOperand(r5, HeapNumber::kValueOffset)); |
5494 #else | 5492 #else |
5495 // Double returned in registers 0 and 1. | 5493 // Double returned in registers 0 and 1. |
5496 __ str(r0, FieldMemOperand(r4, HeapNumber::kValueOffset)); | 5494 __ strd(r0, FieldMemOperand(r4, HeapNumber::kValueOffset)); |
5497 __ str(r1, FieldMemOperand(r4, HeapNumber::kValueOffset + 4)); | |
5498 #endif | 5495 #endif |
5499 __ mov(r0, Operand(r4)); | 5496 __ mov(r0, Operand(r4)); |
5500 // And we are done. | 5497 // And we are done. |
5501 __ pop(pc); | 5498 __ pop(pc); |
5502 } | 5499 } |
5503 | 5500 |
5504 | 5501 |
5505 // Tries to get a signed int32 out of a double precision floating point heap | 5502 // Tries to get a signed int32 out of a double precision floating point heap |
5506 // number. Rounds towards 0. Fastest for doubles that are in the ranges | 5503 // number. Rounds towards 0. Fastest for doubles that are in the ranges |
5507 // -0x7fffffff to -0x40000000 or 0x40000000 to 0x7fffffff. This corresponds | 5504 // -0x7fffffff to -0x40000000 or 0x40000000 to 0x7fffffff. This corresponds |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6870 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 6867 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
6871 // tagged as a small integer. | 6868 // tagged as a small integer. |
6872 __ bind(&runtime); | 6869 __ bind(&runtime); |
6873 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 6870 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); |
6874 } | 6871 } |
6875 | 6872 |
6876 | 6873 |
6877 #undef __ | 6874 #undef __ |
6878 | 6875 |
6879 } } // namespace v8::internal | 6876 } } // namespace v8::internal |
OLD | NEW |