Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 6973001: Propagate a Failure from GenerateDictionaryNegativeLookup instead of causing GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/code-stubs-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 5985 matching lines...) Expand 10 before | Expand all | Expand 10 after
5996 // Do a tail call to the rewritten stub. 5996 // Do a tail call to the rewritten stub.
5997 __ jmp(Operand(edi)); 5997 __ jmp(Operand(edi));
5998 } 5998 }
5999 5999
6000 6000
6001 // Helper function used to check that the dictionary doesn't contain 6001 // Helper function used to check that the dictionary doesn't contain
6002 // the property. This function may return false negatives, so miss_label 6002 // the property. This function may return false negatives, so miss_label
6003 // must always call a backup property check that is complete. 6003 // must always call a backup property check that is complete.
6004 // This function is safe to call if the receiver has fast properties. 6004 // This function is safe to call if the receiver has fast properties.
6005 // Name must be a symbol and receiver must be a heap object. 6005 // Name must be a symbol and receiver must be a heap object.
6006 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, 6006 MaybeObject* StringDictionaryLookupStub::GenerateNegativeLookup(
6007 Label* miss, 6007 MacroAssembler* masm,
6008 Label* done, 6008 Label* miss,
6009 Register properties, 6009 Label* done,
6010 String* name, 6010 Register properties,
6011 Register r0) { 6011 String* name,
6012 Register r0) {
6012 ASSERT(name->IsSymbol()); 6013 ASSERT(name->IsSymbol());
6013 6014
6014 // If names of slots in range from 1 to kProbes - 1 for the hash value are 6015 // If names of slots in range from 1 to kProbes - 1 for the hash value are
6015 // not equal to the name and kProbes-th slot is not used (its name is the 6016 // not equal to the name and kProbes-th slot is not used (its name is the
6016 // undefined value), it guarantees the hash table doesn't contain the 6017 // undefined value), it guarantees the hash table doesn't contain the
6017 // property. It's true even if some slots represent deleted properties 6018 // property. It's true even if some slots represent deleted properties
6018 // (their names are the null value). 6019 // (their names are the null value).
6019 for (int i = 0; i < kInlinedProbes; i++) { 6020 for (int i = 0; i < kInlinedProbes; i++) {
6020 // Compute the masked index: (hash + i + i * i) & mask. 6021 // Compute the masked index: (hash + i + i * i) & mask.
6021 Register index = r0; 6022 Register index = r0;
(...skipping 25 matching lines...) Expand all
6047 kIsSymbolMask); 6048 kIsSymbolMask);
6048 __ j(zero, miss, not_taken); 6049 __ j(zero, miss, not_taken);
6049 } 6050 }
6050 6051
6051 StringDictionaryLookupStub stub(properties, 6052 StringDictionaryLookupStub stub(properties,
6052 r0, 6053 r0,
6053 r0, 6054 r0,
6054 StringDictionaryLookupStub::NEGATIVE_LOOKUP); 6055 StringDictionaryLookupStub::NEGATIVE_LOOKUP);
6055 __ push(Immediate(Handle<Object>(name))); 6056 __ push(Immediate(Handle<Object>(name)));
6056 __ push(Immediate(name->Hash())); 6057 __ push(Immediate(name->Hash()));
6057 __ CallStub(&stub); 6058 MaybeObject* result = masm->TryCallStub(&stub);
6059 if (result->IsFailure()) return result;
6058 __ test(r0, Operand(r0)); 6060 __ test(r0, Operand(r0));
6059 __ j(not_zero, miss); 6061 __ j(not_zero, miss);
6060 __ jmp(done); 6062 __ jmp(done);
6063 return result;
6061 } 6064 }
6062 6065
6063 6066
6064 // Probe the string dictionary in the |elements| register. Jump to the 6067 // Probe the string dictionary in the |elements| register. Jump to the
6065 // |done| label if a property with the given name is found leaving the 6068 // |done| label if a property with the given name is found leaving the
6066 // index into the dictionary in |r0|. Jump to the |miss| label 6069 // index into the dictionary in |r0|. Jump to the |miss| label
6067 // otherwise. 6070 // otherwise.
6068 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, 6071 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm,
6069 Label* miss, 6072 Label* miss,
6070 Label* done, 6073 Label* done,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
6205 __ Drop(1); 6208 __ Drop(1);
6206 __ ret(2 * kPointerSize); 6209 __ ret(2 * kPointerSize);
6207 } 6210 }
6208 6211
6209 6212
6210 #undef __ 6213 #undef __
6211 6214
6212 } } // namespace v8::internal 6215 } } // namespace v8::internal
6213 6216
6214 #endif // V8_TARGET_ARCH_IA32 6217 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.h ('k') | src/ia32/stub-cache-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698