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

Side by Side Diff: src/ic/ic.cc

Issue 969733003: Prefill with correct contextual load ICs in fullcodegen. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Don't prefill if we'll serialize the code Created 5 years, 9 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
« no previous file with comments | « src/ic/ic.h ('k') | src/x64/full-codegen-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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 Handle<Code> LoadIC::initialize_stub(Isolate* isolate, 942 Handle<Code> LoadIC::initialize_stub(Isolate* isolate,
943 ExtraICState extra_state) { 943 ExtraICState extra_state) {
944 if (FLAG_vector_ics) { 944 if (FLAG_vector_ics) {
945 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode(); 945 return LoadICTrampolineStub(isolate, LoadICState(extra_state)).GetCode();
946 } 946 }
947 947
948 return PropertyICCompiler::ComputeLoad(isolate, UNINITIALIZED, extra_state); 948 return PropertyICCompiler::ComputeLoad(isolate, UNINITIALIZED, extra_state);
949 } 949 }
950 950
951 951
952 Handle<Code> LoadIC::load_global(Isolate* isolate, Handle<GlobalObject> global,
953 Handle<String> name) {
954 Handle<ScriptContextTable> script_contexts(
955 global->native_context()->script_context_table());
956
957 ScriptContextTable::LookupResult lookup_result;
958 if (ScriptContextTable::Lookup(script_contexts, name, &lookup_result)) {
959 return initialize_stub(isolate, LoadICState(CONTEXTUAL).GetExtraICState());
960 }
961
962 Handle<Map> global_map(global->map());
963 Handle<Code> handler = PropertyHandlerCompiler::Find(
964 name, global_map, Code::LOAD_IC, kCacheOnReceiver, Code::NORMAL);
965 if (handler.is_null()) {
966 LookupIterator it(global, name);
967 if (!it.IsFound() || !it.GetHolder<JSObject>().is_identical_to(global) ||
968 it.state() != LookupIterator::DATA) {
969 return initialize_stub(isolate,
970 LoadICState(CONTEXTUAL).GetExtraICState());
971 }
972 NamedLoadHandlerCompiler compiler(isolate, global_map, global,
973 kCacheOnReceiver);
974 Handle<PropertyCell> cell = it.GetPropertyCell();
975 handler = compiler.CompileLoadGlobal(cell, name, it.IsConfigurable());
976 Map::UpdateCodeCache(global_map, name, handler);
977 }
978 return PropertyICCompiler::ComputeMonomorphic(
979 Code::LOAD_IC, name, handle(global->map()), handler,
980 LoadICState(CONTEXTUAL).GetExtraICState());
981 }
982
983
952 Handle<Code> LoadIC::initialize_stub_in_optimized_code( 984 Handle<Code> LoadIC::initialize_stub_in_optimized_code(
953 Isolate* isolate, ExtraICState extra_state, State initialization_state) { 985 Isolate* isolate, ExtraICState extra_state, State initialization_state) {
954 if (FLAG_vector_ics) { 986 if (FLAG_vector_ics) {
955 return VectorLoadStub(isolate, LoadICState(extra_state)).GetCode(); 987 return VectorLoadStub(isolate, LoadICState(extra_state)).GetCode();
956 } 988 }
957 return PropertyICCompiler::ComputeLoad(isolate, initialization_state, 989 return PropertyICCompiler::ComputeLoad(isolate, initialization_state,
958 extra_state); 990 extra_state);
959 } 991 }
960 992
961 993
(...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 static const Address IC_utilities[] = { 3045 static const Address IC_utilities[] = {
3014 #define ADDR(name) FUNCTION_ADDR(name), 3046 #define ADDR(name) FUNCTION_ADDR(name),
3015 IC_UTIL_LIST(ADDR) NULL 3047 IC_UTIL_LIST(ADDR) NULL
3016 #undef ADDR 3048 #undef ADDR
3017 }; 3049 };
3018 3050
3019 3051
3020 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 3052 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
3021 } 3053 }
3022 } // namespace v8::internal 3054 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/ic.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698