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

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

Issue 18357004: Revert r15419: "Generate StoreGlobal stubs with Hydrogen" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/x64/code-stubs-x64.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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 Handle<Code> StubCache::ComputeStoreNormal(StrictModeFlag strict_mode) { 491 Handle<Code> StubCache::ComputeStoreNormal(StrictModeFlag strict_mode) {
492 return (strict_mode == kStrictMode) 492 return (strict_mode == kStrictMode)
493 ? isolate_->builtins()->Builtins::StoreIC_Normal_Strict() 493 ? isolate_->builtins()->Builtins::StoreIC_Normal_Strict()
494 : isolate_->builtins()->Builtins::StoreIC_Normal(); 494 : isolate_->builtins()->Builtins::StoreIC_Normal();
495 } 495 }
496 496
497 497
498 Handle<Code> StubCache::ComputeStoreGlobal(Handle<Name> name, 498 Handle<Code> StubCache::ComputeStoreGlobal(Handle<Name> name,
499 Handle<GlobalObject> receiver, 499 Handle<GlobalObject> receiver,
500 Handle<PropertyCell> cell, 500 Handle<PropertyCell> cell,
501 Handle<Object> value,
502 StrictModeFlag strict_mode) { 501 StrictModeFlag strict_mode) {
503 Isolate* isolate = cell->GetIsolate(); 502 Handle<Code> stub = FindIC(
504 Handle<Type> union_type(cell->UpdateType(*value), isolate); 503 name, Handle<JSObject>::cast(receiver),
505 bool is_constant = union_type->IsConstant(); 504 Code::STORE_IC, Code::NORMAL, strict_mode);
506 StoreGlobalStub stub(strict_mode, is_constant); 505 if (!stub.is_null()) return stub;
507 506
508 Handle<Code> code = FindIC( 507 StoreStubCompiler compiler(isolate_, strict_mode);
509 name, Handle<JSObject>::cast(receiver), 508 Handle<Code> code = compiler.CompileStoreGlobal(receiver, cell, name);
510 Code::STORE_IC, Code::NORMAL, stub.GetExtraICState());
511 if (!code.is_null()) return code;
512
513 if (is_constant) return stub.GetCode(isolate_);
514
515 // Replace the placeholder cell and global object map with the actual global
516 // cell and receiver map.
517 Handle<Map> cell_map(isolate_->heap()->global_property_cell_map());
518 Handle<Map> meta_map(isolate_->heap()->meta_map());
519 Handle<Object> receiver_map(receiver->map(), isolate_);
520 code = stub.GetCodeCopyFromTemplate(isolate_);
521 code->ReplaceNthObject(1, *meta_map, *receiver_map);
522 code->ReplaceNthObject(1, *cell_map, *cell);
523 JSObject::UpdateMapCodeCache(receiver, name, code); 509 JSObject::UpdateMapCodeCache(receiver, name, code);
524
525 return code; 510 return code;
526 } 511 }
527 512
528 513
529 Handle<Code> StubCache::ComputeStoreCallback( 514 Handle<Code> StubCache::ComputeStoreCallback(
530 Handle<Name> name, 515 Handle<Name> name,
531 Handle<JSObject> receiver, 516 Handle<JSObject> receiver,
532 Handle<JSObject> holder, 517 Handle<JSObject> holder,
533 Handle<ExecutableAccessorInfo> callback, 518 Handle<ExecutableAccessorInfo> callback,
534 StrictModeFlag strict_mode) { 519 StrictModeFlag strict_mode) {
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 914
930 Handle<Code> StubCache::ComputeCompareNil(Handle<Map> receiver_map, 915 Handle<Code> StubCache::ComputeCompareNil(Handle<Map> receiver_map,
931 CompareNilICStub& stub) { 916 CompareNilICStub& stub) {
932 Handle<String> name(isolate_->heap()->empty_string()); 917 Handle<String> name(isolate_->heap()->empty_string());
933 if (!receiver_map->is_shared()) { 918 if (!receiver_map->is_shared()) {
934 Handle<Code> cached_ic = FindIC(name, receiver_map, Code::COMPARE_NIL_IC, 919 Handle<Code> cached_ic = FindIC(name, receiver_map, Code::COMPARE_NIL_IC,
935 Code::NORMAL, stub.GetExtraICState()); 920 Code::NORMAL, stub.GetExtraICState());
936 if (!cached_ic.is_null()) return cached_ic; 921 if (!cached_ic.is_null()) return cached_ic;
937 } 922 }
938 923
939 Handle<Code> ic = stub.GetCodeCopyFromTemplate(isolate_); 924 Handle<Code> ic = stub.GetCode(isolate_);
940 ic->ReplaceNthObject(1, isolate_->heap()->meta_map(), *receiver_map); 925
926 // For monomorphic maps, use the code as a template, copying and replacing
927 // the monomorphic map that checks the object's type.
928 ic = isolate_->factory()->CopyCode(ic);
929 ic->ReplaceFirstMap(*receiver_map);
941 930
942 if (!receiver_map->is_shared()) { 931 if (!receiver_map->is_shared()) {
943 Map::UpdateCodeCache(receiver_map, name, ic); 932 Map::UpdateCodeCache(receiver_map, name, ic);
944 } 933 }
945 934
946 return ic; 935 return ic;
947 } 936 }
948 937
949 938
950 Handle<Code> StubCache::ComputeLoadElementPolymorphic( 939 Handle<Code> StubCache::ComputeLoadElementPolymorphic(
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 Handle<FunctionTemplateInfo>( 2099 Handle<FunctionTemplateInfo>(
2111 FunctionTemplateInfo::cast(signature->receiver())); 2100 FunctionTemplateInfo::cast(signature->receiver()));
2112 } 2101 }
2113 } 2102 }
2114 2103
2115 is_simple_api_call_ = true; 2104 is_simple_api_call_ = true;
2116 } 2105 }
2117 2106
2118 2107
2119 } } // namespace v8::internal 2108 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698