| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 GenerateTypeTransition(masm); | 289 GenerateTypeTransition(masm); |
| 290 } | 290 } |
| 291 | 291 |
| 292 | 292 |
| 293 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { | 293 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { |
| 294 ASSERT(*known_map_ != NULL); | 294 ASSERT(*known_map_ != NULL); |
| 295 Isolate* isolate = new_object->GetIsolate(); | 295 Isolate* isolate = new_object->GetIsolate(); |
| 296 Factory* factory = isolate->factory(); | 296 Factory* factory = isolate->factory(); |
| 297 return Map::UpdateCodeCache(known_map_, | 297 return Map::UpdateCodeCache(known_map_, |
| 298 strict() ? | 298 strict() ? |
| 299 factory->strict_compare_ic_symbol() : | 299 factory->strict_compare_ic_string() : |
| 300 factory->compare_ic_symbol(), | 300 factory->compare_ic_string(), |
| 301 new_object); | 301 new_object); |
| 302 } | 302 } |
| 303 | 303 |
| 304 | 304 |
| 305 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out, Isolate* isolate) { | 305 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out, Isolate* isolate) { |
| 306 Factory* factory = isolate->factory(); | 306 Factory* factory = isolate->factory(); |
| 307 Code::Flags flags = Code::ComputeFlags( | 307 Code::Flags flags = Code::ComputeFlags( |
| 308 static_cast<Code::Kind>(GetCodeKind()), | 308 static_cast<Code::Kind>(GetCodeKind()), |
| 309 UNINITIALIZED); | 309 UNINITIALIZED); |
| 310 ASSERT(op_ == Token::EQ || op_ == Token::EQ_STRICT); | 310 ASSERT(op_ == Token::EQ || op_ == Token::EQ_STRICT); |
| 311 Handle<Object> probe( | 311 Handle<Object> probe( |
| 312 known_map_->FindInCodeCache( | 312 known_map_->FindInCodeCache( |
| 313 strict() ? | 313 strict() ? |
| 314 *factory->strict_compare_ic_symbol() : | 314 *factory->strict_compare_ic_string() : |
| 315 *factory->compare_ic_symbol(), | 315 *factory->compare_ic_string(), |
| 316 flags)); | 316 flags)); |
| 317 if (probe->IsCode()) { | 317 if (probe->IsCode()) { |
| 318 *code_out = Code::cast(*probe); | 318 *code_out = Code::cast(*probe); |
| 319 #ifdef DEBUG | 319 #ifdef DEBUG |
| 320 Token::Value cached_op; | 320 Token::Value cached_op; |
| 321 ICCompareStub::DecodeMinorKey((*code_out)->stub_info(), NULL, NULL, NULL, | 321 ICCompareStub::DecodeMinorKey((*code_out)->stub_info(), NULL, NULL, NULL, |
| 322 &cached_op); | 322 &cached_op); |
| 323 ASSERT(op_ == cached_op); | 323 ASSERT(op_ == cached_op); |
| 324 #endif | 324 #endif |
| 325 return true; | 325 return true; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 break; | 366 break; |
| 367 case CompareIC::SMI: | 367 case CompareIC::SMI: |
| 368 GenerateSmis(masm); | 368 GenerateSmis(masm); |
| 369 break; | 369 break; |
| 370 case CompareIC::HEAP_NUMBER: | 370 case CompareIC::HEAP_NUMBER: |
| 371 GenerateHeapNumbers(masm); | 371 GenerateHeapNumbers(masm); |
| 372 break; | 372 break; |
| 373 case CompareIC::STRING: | 373 case CompareIC::STRING: |
| 374 GenerateStrings(masm); | 374 GenerateStrings(masm); |
| 375 break; | 375 break; |
| 376 case CompareIC::SYMBOL: | 376 case CompareIC::INTERNALIZED_STRING: |
| 377 GenerateSymbols(masm); | 377 GenerateInternalizedStrings(masm); |
| 378 break; | 378 break; |
| 379 case CompareIC::OBJECT: | 379 case CompareIC::OBJECT: |
| 380 GenerateObjects(masm); | 380 GenerateObjects(masm); |
| 381 break; | 381 break; |
| 382 case CompareIC::KNOWN_OBJECTS: | 382 case CompareIC::KNOWN_OBJECTS: |
| 383 ASSERT(*known_map_ != NULL); | 383 ASSERT(*known_map_ != NULL); |
| 384 GenerateKnownObjects(masm); | 384 GenerateKnownObjects(masm); |
| 385 break; | 385 break; |
| 386 case CompareIC::GENERIC: | 386 case CompareIC::GENERIC: |
| 387 GenerateGeneric(masm); | 387 GenerateGeneric(masm); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // already active, as the hooks won't stack. | 629 // already active, as the hooks won't stack. |
| 630 if (entry_hook != 0 && entry_hook_ != 0) | 630 if (entry_hook != 0 && entry_hook_ != 0) |
| 631 return false; | 631 return false; |
| 632 | 632 |
| 633 entry_hook_ = entry_hook; | 633 entry_hook_ = entry_hook; |
| 634 return true; | 634 return true; |
| 635 } | 635 } |
| 636 | 636 |
| 637 | 637 |
| 638 } } // namespace v8::internal | 638 } } // namespace v8::internal |
| OLD | NEW |