Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 | 44 |
| 45 static void ProbeTable(MacroAssembler* masm, | 45 static void ProbeTable(MacroAssembler* masm, |
| 46 Code::Flags flags, | 46 Code::Flags flags, |
| 47 StubCache::Table table, | 47 StubCache::Table table, |
| 48 Register name, | 48 Register name, |
| 49 Register offset) { | 49 Register offset) { |
| 50 ExternalReference key_offset(SCTableReference::keyReference(table)); | 50 ExternalReference key_offset(SCTableReference::keyReference(table)); |
| 51 Label miss; | 51 Label miss; |
| 52 | 52 |
| 53 __ movq(kScratchRegister, key_offset); | 53 __ movq(kScratchRegister, key_offset); |
| 54 SmiIndex index = masm->SmiToIndex(offset, offset, kPointerSizeLog2); | |
| 54 // Check that the key in the entry matches the name. | 55 // Check that the key in the entry matches the name. |
| 55 __ cmpl(name, Operand(kScratchRegister, offset, times_4, 0)); | 56 __ cmpl(name, Operand(kScratchRegister, index.reg, index.scale, 0)); |
|
William Hesse
2009/09/15 10:12:09
Document that offset must be zero-extended in the
Lasse Reichstein
2009/09/15 10:39:08
Fixed in SmiToIndex instead.
I'll document that o
| |
| 56 __ j(not_equal, &miss); | 57 __ j(not_equal, &miss); |
| 57 // Get the code entry from the cache. | 58 // Get the code entry from the cache. |
| 58 // Use key_offset + kPointerSize, rather than loading value_offset. | 59 // Use key_offset + kPointerSize, rather than loading value_offset. |
| 59 __ movq(kScratchRegister, | 60 __ movq(kScratchRegister, |
| 60 Operand(kScratchRegister, offset, times_4, kPointerSize)); | 61 Operand(kScratchRegister, index.reg, index.scale, kPointerSize)); |
| 61 // Check that the flags match what we're looking for. | 62 // Check that the flags match what we're looking for. |
| 62 __ movl(offset, FieldOperand(kScratchRegister, Code::kFlagsOffset)); | 63 __ movl(offset, FieldOperand(kScratchRegister, Code::kFlagsOffset)); |
| 63 __ and_(offset, Immediate(~Code::kFlagsNotUsedInLookup)); | 64 __ and_(offset, Immediate(~Code::kFlagsNotUsedInLookup)); |
| 64 __ cmpl(offset, Immediate(flags)); | 65 __ cmpl(offset, Immediate(flags)); |
| 65 __ j(not_equal, &miss); | 66 __ j(not_equal, &miss); |
| 66 | 67 |
| 67 // Jump to the first instruction in the code stub. | 68 // Jump to the first instruction in the code stub. |
| 68 __ addq(kScratchRegister, Immediate(Code::kHeaderSize - kHeapObjectTag)); | 69 __ addq(kScratchRegister, Immediate(Code::kHeaderSize - kHeapObjectTag)); |
| 69 __ jmp(kScratchRegister); | 70 __ jmp(kScratchRegister); |
| 70 | 71 |
| (...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1848 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); | 1849 __ Jump(generic_construct_stub, RelocInfo::CODE_TARGET); |
| 1849 | 1850 |
| 1850 // Return the generated code. | 1851 // Return the generated code. |
| 1851 return GetCode(); | 1852 return GetCode(); |
| 1852 } | 1853 } |
| 1853 | 1854 |
| 1854 | 1855 |
| 1855 #undef __ | 1856 #undef __ |
| 1856 | 1857 |
| 1857 } } // namespace v8::internal | 1858 } } // namespace v8::internal |
| OLD | NEW |