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

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

Issue 10515008: Added LoadIC stub for getters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Incorporated review comments. Created 8 years, 6 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/stub-cache-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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 LoadStubCompiler compiler(isolate_); 164 LoadStubCompiler compiler(isolate_);
165 Handle<Code> code = 165 Handle<Code> code =
166 compiler.CompileLoadCallback(name, receiver, holder, callback); 166 compiler.CompileLoadCallback(name, receiver, holder, callback);
167 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 167 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
168 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 168 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
169 JSObject::UpdateMapCodeCache(receiver, name, code); 169 JSObject::UpdateMapCodeCache(receiver, name, code);
170 return code; 170 return code;
171 } 171 }
172 172
173 173
174 Handle<Code> StubCache::ComputeLoadViaGetter(Handle<String> name,
175 Handle<JSObject> receiver,
176 Handle<JSObject> holder,
177 Handle<JSFunction> getter) {
178 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
179 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, CALLBACKS);
180 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
181 if (probe->IsCode()) return Handle<Code>::cast(probe);
182
183 LoadStubCompiler compiler(isolate_);
184 Handle<Code> code =
185 compiler.CompileLoadViaGetter(name, receiver, holder, getter);
186 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
187 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
188 JSObject::UpdateMapCodeCache(receiver, name, code);
189 return code;
190 }
191
192
174 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, 193 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name,
175 Handle<JSObject> receiver, 194 Handle<JSObject> receiver,
176 Handle<JSObject> holder, 195 Handle<JSObject> holder,
177 Handle<JSFunction> value) { 196 Handle<JSFunction> value) {
178 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 197 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
179 Code::Flags flags = 198 Code::Flags flags =
180 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION); 199 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION);
181 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 200 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
182 if (probe->IsCode()) return Handle<Code>::cast(probe); 201 if (probe->IsCode()) return Handle<Code>::cast(probe);
183 202
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 Handle<FunctionTemplateInfo>( 1546 Handle<FunctionTemplateInfo>(
1528 FunctionTemplateInfo::cast(signature->receiver())); 1547 FunctionTemplateInfo::cast(signature->receiver()));
1529 } 1548 }
1530 } 1549 }
1531 1550
1532 is_simple_api_call_ = true; 1551 is_simple_api_call_ = true;
1533 } 1552 }
1534 1553
1535 1554
1536 } } // namespace v8::internal 1555 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « 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