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

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

Issue 11973008: Replace special IC builtins and stubs in the map's cache by codestubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 years, 11 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/type-info.h » ('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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 358
359 KeyedLoadStubCompiler compiler(isolate_); 359 KeyedLoadStubCompiler compiler(isolate_);
360 Handle<Code> code = compiler.CompileLoadArrayLength(name); 360 Handle<Code> code = compiler.CompileLoadArrayLength(name);
361 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name)); 361 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
362 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code)); 362 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
363 JSObject::UpdateMapCodeCache(receiver, name, code); 363 JSObject::UpdateMapCodeCache(receiver, name, code);
364 return code; 364 return code;
365 } 365 }
366 366
367 367
368 Handle<Code> StubCache::ComputeKeyedLoadStringLength(Handle<String> name,
369 Handle<String> receiver) {
370 Code::Flags flags =
371 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS);
372 Handle<Map> map(receiver->map());
373 Handle<Object> probe(map->FindInCodeCache(*name, flags), isolate_);
374 if (probe->IsCode()) return Handle<Code>::cast(probe);
375
376 KeyedLoadStubCompiler compiler(isolate_);
377 Handle<Code> code = compiler.CompileLoadStringLength(name);
378 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, *name));
379 GDBJIT(AddCode(GDBJITInterface::KEYED_LOAD_IC, *name, *code));
380 Map::UpdateCodeCache(map, name, code);
381 return code;
382 }
383
384
385 Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype( 368 Handle<Code> StubCache::ComputeKeyedLoadFunctionPrototype(
386 Handle<String> name, 369 Handle<String> name,
387 Handle<JSFunction> receiver) { 370 Handle<JSFunction> receiver) {
388 Code::Flags flags = 371 Code::Flags flags =
389 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS); 372 Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC, Code::CALLBACKS);
390 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags), 373 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags),
391 isolate_); 374 isolate_);
392 if (probe->IsCode()) return Handle<Code>::cast(probe); 375 if (probe->IsCode()) return Handle<Code>::cast(probe);
393 376
394 KeyedLoadStubCompiler compiler(isolate_); 377 KeyedLoadStubCompiler compiler(isolate_);
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 Handle<FunctionTemplateInfo>( 1586 Handle<FunctionTemplateInfo>(
1604 FunctionTemplateInfo::cast(signature->receiver())); 1587 FunctionTemplateInfo::cast(signature->receiver()));
1605 } 1588 }
1606 } 1589 }
1607 1590
1608 is_simple_api_call_ = true; 1591 is_simple_api_call_ = true;
1609 } 1592 }
1610 1593
1611 1594
1612 } } // namespace v8::internal 1595 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/type-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698