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

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

Issue 68523009: Also support smi in load-ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 Code::HANDLER, extra_ic_state, cache_holder, Code::NORMAL, kind); 128 Code::HANDLER, extra_ic_state, cache_holder, Code::NORMAL, kind);
129 129
130 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags), 130 Handle<Object> probe(stub_holder->map()->FindInCodeCache(*name, flags),
131 isolate_); 131 isolate_);
132 if (probe->IsCode()) return Handle<Code>::cast(probe); 132 if (probe->IsCode()) return Handle<Code>::cast(probe);
133 return Handle<Code>::null(); 133 return Handle<Code>::null();
134 } 134 }
135 135
136 136
137 Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name, 137 Handle<Code> StubCache::ComputeMonomorphicIC(Handle<Name> name,
138 Handle<HeapObject> object, 138 Handle<Object> object,
139 Handle<Code> handler, 139 Handle<Code> handler,
140 StrictModeFlag strict_mode) { 140 StrictModeFlag strict_mode) {
141 Code::Kind kind = handler->handler_kind(); 141 Code::Kind kind = handler->handler_kind();
142 // Use the same cache holder for the IC as for the handler. 142 // Use the same cache holder for the IC as for the handler.
143 InlineCacheHolderFlag cache_holder = 143 InlineCacheHolderFlag cache_holder =
144 Code::ExtractCacheHolderFromFlags(handler->flags()); 144 Code::ExtractCacheHolderFromFlags(handler->flags());
145 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder( 145 Handle<HeapObject> stub_holder(IC::GetCodeCacheHolder(
146 isolate(), *object, cache_holder)); 146 isolate(), *object, cache_holder));
147 Handle<Map> stub_holder_map(stub_holder->map()); 147 Handle<Map> stub_holder_map(stub_holder->map());
148 Handle<Code> ic = FindIC( 148 Handle<Code> ic = FindIC(
149 name, stub_holder_map, kind, strict_mode, cache_holder); 149 name, stub_holder_map, kind, strict_mode, cache_holder);
150 if (!ic.is_null()) return ic; 150 if (!ic.is_null()) return ic;
151 151
152 Handle<Map> map(object->map()); 152 Handle<Map> map(object->GetMarkerMap(isolate()));
153 if (kind == Code::LOAD_IC) { 153 if (kind == Code::LOAD_IC) {
154 LoadStubCompiler ic_compiler(isolate(), cache_holder); 154 LoadStubCompiler ic_compiler(isolate(), cache_holder);
155 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); 155 ic = ic_compiler.CompileMonomorphicIC(map, handler, name);
156 } else if (kind == Code::KEYED_LOAD_IC) { 156 } else if (kind == Code::KEYED_LOAD_IC) {
157 KeyedLoadStubCompiler ic_compiler(isolate(), cache_holder); 157 KeyedLoadStubCompiler ic_compiler(isolate(), cache_holder);
158 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); 158 ic = ic_compiler.CompileMonomorphicIC(map, handler, name);
159 } else if (kind == Code::STORE_IC) { 159 } else if (kind == Code::STORE_IC) {
160 StoreStubCompiler ic_compiler(isolate(), strict_mode); 160 StoreStubCompiler ic_compiler(isolate(), strict_mode);
161 ic = ic_compiler.CompileMonomorphicIC(map, handler, name); 161 ic = ic_compiler.CompileMonomorphicIC(map, handler, name);
162 } else { 162 } else {
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1813 Handle<FunctionTemplateInfo>( 1813 Handle<FunctionTemplateInfo>(
1814 FunctionTemplateInfo::cast(signature->receiver())); 1814 FunctionTemplateInfo::cast(signature->receiver()));
1815 } 1815 }
1816 } 1816 }
1817 1817
1818 is_simple_api_call_ = true; 1818 is_simple_api_call_ = true;
1819 } 1819 }
1820 1820
1821 1821
1822 } } // namespace v8::internal 1822 } } // namespace v8::internal
OLDNEW
« src/ic-inl.h ('K') | « src/stub-cache.h ('k') | src/x64/stub-cache-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698