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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 void CodeStub::PrintName(StringStream* stream) { | 165 void CodeStub::PrintName(StringStream* stream) { |
166 stream->Add("%s", MajorName(MajorKey(), false)); | 166 stream->Add("%s", MajorName(MajorKey(), false)); |
167 } | 167 } |
168 | 168 |
169 | 169 |
170 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { | 170 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { |
171 ASSERT(*known_map_ != NULL); | 171 ASSERT(*known_map_ != NULL); |
172 Isolate* isolate = new_object->GetIsolate(); | 172 Isolate* isolate = new_object->GetIsolate(); |
173 Factory* factory = isolate->factory(); | 173 Factory* factory = isolate->factory(); |
174 return Map::UpdateCodeCache(known_map_, | 174 return Map::UpdateCodeCache(known_map_, |
175 factory->compare_ic_symbol(), | 175 strict() ? |
| 176 factory->strict_compare_ic_symbol() : |
| 177 factory->compare_ic_symbol(), |
176 new_object); | 178 new_object); |
177 } | 179 } |
178 | 180 |
179 | 181 |
180 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) { | 182 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) { |
181 Isolate* isolate = known_map_->GetIsolate(); | 183 Isolate* isolate = known_map_->GetIsolate(); |
182 Factory* factory = isolate->factory(); | 184 Factory* factory = isolate->factory(); |
183 Code::Flags flags = Code::ComputeFlags( | 185 Code::Flags flags = Code::ComputeFlags( |
184 static_cast<Code::Kind>(GetCodeKind()), | 186 static_cast<Code::Kind>(GetCodeKind()), |
185 UNINITIALIZED); | 187 UNINITIALIZED); |
| 188 ASSERT(op_ == Token::EQ || op_ == Token::EQ_STRICT); |
186 Handle<Object> probe( | 189 Handle<Object> probe( |
187 known_map_->FindInCodeCache(*factory->compare_ic_symbol(), flags)); | 190 known_map_->FindInCodeCache( |
| 191 strict() ? |
| 192 *factory->strict_compare_ic_symbol() : |
| 193 *factory->compare_ic_symbol(), |
| 194 flags)); |
188 if (probe->IsCode()) { | 195 if (probe->IsCode()) { |
189 *code_out = Code::cast(*probe); | 196 *code_out = Code::cast(*probe); |
| 197 ASSERT(op_ == (*code_out)->compare_operation() + Token::EQ); |
190 return true; | 198 return true; |
191 } | 199 } |
192 return false; | 200 return false; |
193 } | 201 } |
194 | 202 |
195 | 203 |
196 int ICCompareStub::MinorKey() { | 204 int ICCompareStub::MinorKey() { |
197 return OpField::encode(op_ - Token::EQ) | StateField::encode(state_); | 205 return OpField::encode(op_ - Token::EQ) | StateField::encode(state_); |
198 } | 206 } |
199 | 207 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 // already active, as the hooks won't stack. | 494 // already active, as the hooks won't stack. |
487 if (entry_hook != 0 && entry_hook_ != 0) | 495 if (entry_hook != 0 && entry_hook_ != 0) |
488 return false; | 496 return false; |
489 | 497 |
490 entry_hook_ = entry_hook; | 498 entry_hook_ = entry_hook; |
491 return true; | 499 return true; |
492 } | 500 } |
493 | 501 |
494 | 502 |
495 } } // namespace v8::internal | 503 } } // namespace v8::internal |
OLD | NEW |