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

Side by Side Diff: src/arm/code-stubs-arm.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/arm/code-stubs-arm.h ('k') | src/arm/macro-assembler-arm.h » ('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 6086 matching lines...) Expand 10 before | Expand all | Expand 10 after
6097 void DirectCEntryStub::GenerateCall(MacroAssembler* masm, 6097 void DirectCEntryStub::GenerateCall(MacroAssembler* masm,
6098 Register target) { 6098 Register target) {
6099 __ mov(lr, Operand(reinterpret_cast<intptr_t>(GetCode().location()), 6099 __ mov(lr, Operand(reinterpret_cast<intptr_t>(GetCode().location()),
6100 RelocInfo::CODE_TARGET)); 6100 RelocInfo::CODE_TARGET));
6101 // Push return address (accessible to GC through exit frame pc). 6101 // Push return address (accessible to GC through exit frame pc).
6102 __ str(pc, MemOperand(sp, 0)); 6102 __ str(pc, MemOperand(sp, 0));
6103 __ Jump(target); // Call the C++ function. 6103 __ Jump(target); // Call the C++ function.
6104 } 6104 }
6105 6105
6106 6106
6107 void StringDictionaryLookupStub::GenerateNegativeLookup(MacroAssembler* masm, 6107 MaybeObject* StringDictionaryLookupStub::GenerateNegativeLookup(
6108 Label* miss, 6108 MacroAssembler* masm,
6109 Label* done, 6109 Label* miss,
6110 Register receiver, 6110 Label* done,
6111 Register properties, 6111 Register receiver,
6112 String* name, 6112 Register properties,
6113 Register scratch0) { 6113 String* name,
6114 Register scratch0) {
6114 // If names of slots in range from 1 to kProbes - 1 for the hash value are 6115 // If names of slots in range from 1 to kProbes - 1 for the hash value are
6115 // not equal to the name and kProbes-th slot is not used (its name is the 6116 // not equal to the name and kProbes-th slot is not used (its name is the
6116 // undefined value), it guarantees the hash table doesn't contain the 6117 // undefined value), it guarantees the hash table doesn't contain the
6117 // property. It's true even if some slots represent deleted properties 6118 // property. It's true even if some slots represent deleted properties
6118 // (their names are the null value). 6119 // (their names are the null value).
6119 for (int i = 0; i < kInlinedProbes; i++) { 6120 for (int i = 0; i < kInlinedProbes; i++) {
6120 // scratch0 points to properties hash. 6121 // scratch0 points to properties hash.
6121 // Compute the masked index: (hash + i + i * i) & mask. 6122 // Compute the masked index: (hash + i + i * i) & mask.
6122 Register index = scratch0; 6123 Register index = scratch0;
6123 // Capacity is smi 2^n. 6124 // Capacity is smi 2^n.
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
6161 } 6162 }
6162 6163
6163 const int spill_mask = 6164 const int spill_mask =
6164 (lr.bit() | r6.bit() | r5.bit() | r4.bit() | r3.bit() | 6165 (lr.bit() | r6.bit() | r5.bit() | r4.bit() | r3.bit() |
6165 r2.bit() | r1.bit() | r0.bit()); 6166 r2.bit() | r1.bit() | r0.bit());
6166 6167
6167 __ stm(db_w, sp, spill_mask); 6168 __ stm(db_w, sp, spill_mask);
6168 __ ldr(r0, FieldMemOperand(receiver, JSObject::kPropertiesOffset)); 6169 __ ldr(r0, FieldMemOperand(receiver, JSObject::kPropertiesOffset));
6169 __ mov(r1, Operand(Handle<String>(name))); 6170 __ mov(r1, Operand(Handle<String>(name)));
6170 StringDictionaryLookupStub stub(NEGATIVE_LOOKUP); 6171 StringDictionaryLookupStub stub(NEGATIVE_LOOKUP);
6171 __ CallStub(&stub); 6172 MaybeObject* result = masm->TryCallStub(&stub);
6173 if (result->IsFailure()) return result;
6172 __ tst(r0, Operand(r0)); 6174 __ tst(r0, Operand(r0));
6173 __ ldm(ia_w, sp, spill_mask); 6175 __ ldm(ia_w, sp, spill_mask);
6174 6176
6175 __ b(eq, done); 6177 __ b(eq, done);
6176 __ b(ne, miss); 6178 __ b(ne, miss);
6179 return result;
6177 } 6180 }
6178 6181
6179 6182
6180 // Probe the string dictionary in the |elements| register. Jump to the 6183 // Probe the string dictionary in the |elements| register. Jump to the
6181 // |done| label if a property with the given name is found. Jump to 6184 // |done| label if a property with the given name is found. Jump to
6182 // the |miss| label otherwise. 6185 // the |miss| label otherwise.
6183 // If lookup was successful |scratch2| will be equal to elements + 4 * index. 6186 // If lookup was successful |scratch2| will be equal to elements + 4 * index.
6184 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm, 6187 void StringDictionaryLookupStub::GeneratePositiveLookup(MacroAssembler* masm,
6185 Label* miss, 6188 Label* miss,
6186 Label* done, 6189 Label* done,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
6332 __ mov(result, Operand(0)); 6335 __ mov(result, Operand(0));
6333 __ Ret(); 6336 __ Ret();
6334 } 6337 }
6335 6338
6336 6339
6337 #undef __ 6340 #undef __
6338 6341
6339 } } // namespace v8::internal 6342 } } // namespace v8::internal
6340 6343
6341 #endif // V8_TARGET_ARCH_ARM 6344 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.h ('k') | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698