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

Side by Side Diff: src/stub-cache.cc

Issue 14611006: Cleanup IC heuristics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nit Created 7 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/objects.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 } 424 }
425 425
426 426
427 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name, 427 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name,
428 Handle<JSObject> receiver, 428 Handle<JSObject> receiver,
429 LookupResult* lookup, 429 LookupResult* lookup,
430 Handle<Map> transition, 430 Handle<Map> transition,
431 StrictModeFlag strict_mode) { 431 StrictModeFlag strict_mode) {
432 Handle<Code> stub = FindIC( 432 Handle<Code> stub = FindIC(
433 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode); 433 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode);
434 if (!stub.is_null()) { 434 if (!stub.is_null()) return stub;
435 MapHandleList embedded_maps;
436 stub->FindAllMaps(&embedded_maps);
437 for (int i = 0; i < embedded_maps.length(); i++) {
438 if (embedded_maps.at(i).is_identical_to(transition)) {
439 return stub;
440 }
441 }
442 }
443 435
444 StoreStubCompiler compiler(isolate_, strict_mode); 436 StoreStubCompiler compiler(isolate_, strict_mode);
445 Handle<Code> code = 437 Handle<Code> code =
446 compiler.CompileStoreTransition(receiver, lookup, transition, name); 438 compiler.CompileStoreTransition(receiver, lookup, transition, name);
447 JSObject::UpdateMapCodeCache(receiver, name, code); 439 JSObject::UpdateMapCodeCache(receiver, name, code);
448 return code; 440 return code;
449 } 441 }
450 442
451 443
452 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) { 444 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 574
583 575
584 Handle<Code> StubCache::ComputeKeyedStoreTransition( 576 Handle<Code> StubCache::ComputeKeyedStoreTransition(
585 Handle<Name> name, 577 Handle<Name> name,
586 Handle<JSObject> receiver, 578 Handle<JSObject> receiver,
587 LookupResult* lookup, 579 LookupResult* lookup,
588 Handle<Map> transition, 580 Handle<Map> transition,
589 StrictModeFlag strict_mode) { 581 StrictModeFlag strict_mode) {
590 Handle<Code> stub = FindIC( 582 Handle<Code> stub = FindIC(
591 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode); 583 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode);
592 if (!stub.is_null()) { 584 if (!stub.is_null()) return stub;
593 MapHandleList embedded_maps;
594 stub->FindAllMaps(&embedded_maps);
595 for (int i = 0; i < embedded_maps.length(); i++) {
596 if (embedded_maps.at(i).is_identical_to(transition)) {
597 return stub;
598 }
599 }
600 }
601 585
602 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE); 586 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE);
603 Handle<Code> code = 587 Handle<Code> code =
604 compiler.CompileStoreTransition(receiver, lookup, transition, name); 588 compiler.CompileStoreTransition(receiver, lookup, transition, name);
605 JSObject::UpdateMapCodeCache(receiver, name, code); 589 JSObject::UpdateMapCodeCache(receiver, name, code);
606 return code; 590 return code;
607 } 591 }
608 592
609 593
610 #define CALL_LOGGER_TAG(kind, type) \ 594 #define CALL_LOGGER_TAG(kind, type) \
(...skipping 1505 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 Handle<FunctionTemplateInfo>( 2100 Handle<FunctionTemplateInfo>(
2117 FunctionTemplateInfo::cast(signature->receiver())); 2101 FunctionTemplateInfo::cast(signature->receiver()));
2118 } 2102 }
2119 } 2103 }
2120 2104
2121 is_simple_api_call_ = true; 2105 is_simple_api_call_ = true;
2122 } 2106 }
2123 2107
2124 2108
2125 } } // namespace v8::internal 2109 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698