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

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

Issue 14146005: Track representations of fields (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add test for tracking fields Created 7 years, 8 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/stub-cache.h ('k') | src/transitions.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 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 } 414 }
415 415
416 416
417 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name, 417 Handle<Code> StubCache::ComputeStoreTransition(Handle<Name> name,
418 Handle<JSObject> receiver, 418 Handle<JSObject> receiver,
419 LookupResult* lookup, 419 LookupResult* lookup,
420 Handle<Map> transition, 420 Handle<Map> transition,
421 StrictModeFlag strict_mode) { 421 StrictModeFlag strict_mode) {
422 Handle<Code> stub = FindIC( 422 Handle<Code> stub = FindIC(
423 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode); 423 name, receiver, Code::STORE_IC, Code::MAP_TRANSITION, strict_mode);
424 if (!stub.is_null()) return stub; 424 if (!stub.is_null()) {
425 MapHandleList embedded_maps;
426 stub->FindAllMaps(&embedded_maps);
427 for (int i = 0; i < embedded_maps.length(); i++) {
428 if (embedded_maps.at(i).is_identical_to(transition)) {
429 return stub;
430 }
431 }
432 }
425 433
426 StoreStubCompiler compiler(isolate_, strict_mode); 434 StoreStubCompiler compiler(isolate_, strict_mode);
427 Handle<Code> code = 435 Handle<Code> code =
428 compiler.CompileStoreTransition(receiver, lookup, transition, name); 436 compiler.CompileStoreTransition(receiver, lookup, transition, name);
429 JSObject::UpdateMapCodeCache(receiver, name, code); 437 JSObject::UpdateMapCodeCache(receiver, name, code);
430 return code; 438 return code;
431 } 439 }
432 440
433 441
434 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) { 442 Handle<Code> StubCache::ComputeKeyedLoadElement(Handle<Map> receiver_map) {
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 571
564 572
565 Handle<Code> StubCache::ComputeKeyedStoreTransition( 573 Handle<Code> StubCache::ComputeKeyedStoreTransition(
566 Handle<Name> name, 574 Handle<Name> name,
567 Handle<JSObject> receiver, 575 Handle<JSObject> receiver,
568 LookupResult* lookup, 576 LookupResult* lookup,
569 Handle<Map> transition, 577 Handle<Map> transition,
570 StrictModeFlag strict_mode) { 578 StrictModeFlag strict_mode) {
571 Handle<Code> stub = FindIC( 579 Handle<Code> stub = FindIC(
572 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode); 580 name, receiver, Code::KEYED_STORE_IC, Code::MAP_TRANSITION, strict_mode);
573 if (!stub.is_null()) return stub; 581 if (!stub.is_null()) {
582 MapHandleList embedded_maps;
583 stub->FindAllMaps(&embedded_maps);
584 for (int i = 0; i < embedded_maps.length(); i++) {
585 if (embedded_maps.at(i).is_identical_to(transition)) {
586 return stub;
587 }
588 }
589 }
574 590
575 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE); 591 KeyedStoreStubCompiler compiler(isolate(), strict_mode, STANDARD_STORE);
576 Handle<Code> code = 592 Handle<Code> code =
577 compiler.CompileStoreTransition(receiver, lookup, transition, name); 593 compiler.CompileStoreTransition(receiver, lookup, transition, name);
578 JSObject::UpdateMapCodeCache(receiver, name, code); 594 JSObject::UpdateMapCodeCache(receiver, name, code);
579 return code; 595 return code;
580 } 596 }
581 597
582 598
583 #define CALL_LOGGER_TAG(kind, type) \ 599 #define CALL_LOGGER_TAG(kind, type) \
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 926
911 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment(); 927 isolate()->counters()->keyed_load_polymorphic_stubs()->Increment();
912 928
913 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code); 929 PolymorphicCodeCache::Update(cache, receiver_maps, flags, code);
914 return code; 930 return code;
915 } 931 }
916 932
917 933
918 Handle<Code> StubCache::ComputePolymorphicIC(MapHandleList* receiver_maps, 934 Handle<Code> StubCache::ComputePolymorphicIC(MapHandleList* receiver_maps,
919 CodeHandleList* handlers, 935 CodeHandleList* handlers,
936 int number_of_valid_maps,
920 Handle<Name> name) { 937 Handle<Name> name) {
921 LoadStubCompiler ic_compiler(isolate_); 938 LoadStubCompiler ic_compiler(isolate_);
922 Code::StubType type = handlers->length() == 1 ? handlers->at(0)->type() 939 Code::StubType type = number_of_valid_maps == 1 ? handlers->at(0)->type()
923 : Code::NORMAL; 940 : Code::NORMAL;
924 Handle<Code> ic = ic_compiler.CompilePolymorphicIC( 941 Handle<Code> ic = ic_compiler.CompilePolymorphicIC(
925 receiver_maps, handlers, name, type, PROPERTY); 942 receiver_maps, handlers, name, type, PROPERTY);
926 return ic; 943 return ic;
927 } 944 }
928 945
929 946
930 Handle<Code> StubCache::ComputeStoreElementPolymorphic( 947 Handle<Code> StubCache::ComputeStoreElementPolymorphic(
931 MapHandleList* receiver_maps, 948 MapHandleList* receiver_maps,
932 KeyedAccessStoreMode store_mode, 949 KeyedAccessStoreMode store_mode,
933 StrictModeFlag strict_mode) { 950 StrictModeFlag strict_mode) {
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2062 Handle<FunctionTemplateInfo>( 2079 Handle<FunctionTemplateInfo>(
2063 FunctionTemplateInfo::cast(signature->receiver())); 2080 FunctionTemplateInfo::cast(signature->receiver()));
2064 } 2081 }
2065 } 2082 }
2066 2083
2067 is_simple_api_call_ = true; 2084 is_simple_api_call_ = true;
2068 } 2085 }
2069 2086
2070 2087
2071 } } // namespace v8::internal 2088 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/transitions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698