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

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

Issue 8111006: Allow new-space JSFunction objects as constant-function properties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: rebased Created 9 years 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 177 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
178 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code)); 178 GDBJIT(AddCode(GDBJITInterface::LOAD_IC, *name, *code));
179 JSObject::UpdateMapCodeCache(receiver, name, code); 179 JSObject::UpdateMapCodeCache(receiver, name, code);
180 return code; 180 return code;
181 } 181 }
182 182
183 183
184 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name, 184 Handle<Code> StubCache::ComputeLoadConstant(Handle<String> name,
185 Handle<JSObject> receiver, 185 Handle<JSObject> receiver,
186 Handle<JSObject> holder, 186 Handle<JSObject> holder,
187 Handle<Object> value) { 187 Handle<JSFunction> value) {
188 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 188 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
189 Code::Flags flags = 189 Code::Flags flags =
190 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION); 190 Code::ComputeMonomorphicFlags(Code::LOAD_IC, CONSTANT_FUNCTION);
191 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 191 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
192 if (probe->IsCode()) return Handle<Code>::cast(probe); 192 if (probe->IsCode()) return Handle<Code>::cast(probe);
193 193
194 LoadStubCompiler compiler(isolate_); 194 LoadStubCompiler compiler(isolate_);
195 Handle<Code> code = 195 Handle<Code> code =
196 compiler.CompileLoadConstant(receiver, holder, value, name); 196 compiler.CompileLoadConstant(receiver, holder, value, name);
197 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name)); 197 PROFILE(isolate_, CodeCreateEvent(Logger::LOAD_IC_TAG, *code, *name));
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 259 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
260 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 260 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
261 JSObject::UpdateMapCodeCache(receiver, name, code); 261 JSObject::UpdateMapCodeCache(receiver, name, code);
262 return code; 262 return code;
263 } 263 }
264 264
265 265
266 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name, 266 Handle<Code> StubCache::ComputeKeyedLoadConstant(Handle<String> name,
267 Handle<JSObject> receiver, 267 Handle<JSObject> receiver,
268 Handle<JSObject> holder, 268 Handle<JSObject> holder,
269 Handle<Object> value) { 269 Handle<JSFunction> value) {
270 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 270 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
271 Code::Flags flags = 271 Code::Flags flags =
272 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CONSTANT_FUNCTION); 272 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, CONSTANT_FUNCTION);
273 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 273 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
274 if (probe->IsCode()) return Handle<Code>::cast(probe); 274 if (probe->IsCode()) return Handle<Code>::cast(probe);
275 275
276 KeyedLoadStubCompiler compiler(isolate_); 276 KeyedLoadStubCompiler compiler(isolate_);
277 Handle<Code> code = 277 Handle<Code> code =
278 compiler.CompileLoadConstant(name, receiver, holder, value); 278 compiler.CompileLoadConstant(name, receiver, holder, value);
279 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 279 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
(...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 Handle<FunctionTemplateInfo>( 1506 Handle<FunctionTemplateInfo>(
1507 FunctionTemplateInfo::cast(signature->receiver())); 1507 FunctionTemplateInfo::cast(signature->receiver()));
1508 } 1508 }
1509 } 1509 }
1510 1510
1511 is_simple_api_call_ = true; 1511 is_simple_api_call_ = true;
1512 } 1512 }
1513 1513
1514 1514
1515 } } // namespace v8::internal 1515 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698