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

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

Issue 8375053: Handlify CompileLoadGlobal, CompileLoadElement, CompileLoadPolymorphic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 JSObject::UpdateMapCodeCache(receiver, name, code); 239 JSObject::UpdateMapCodeCache(receiver, name, code);
240 return code; 240 return code;
241 } 241 }
242 242
243 243
244 Handle<Code> StubCache::ComputeLoadNormal() { 244 Handle<Code> StubCache::ComputeLoadNormal() {
245 return isolate_->builtins()->LoadIC_Normal(); 245 return isolate_->builtins()->LoadIC_Normal();
246 } 246 }
247 247
248 248
249 Handle<Code> LoadStubCompiler::CompileLoadGlobal(
250 Handle<JSObject> object,
251 Handle<GlobalObject> holder,
252 Handle<JSGlobalPropertyCell> cell,
253 Handle<String> name,
254 bool is_dont_delete) {
255 CALL_HEAP_FUNCTION(isolate(),
256 (set_failure(NULL),
257 CompileLoadGlobal(
258 *object, *holder, *cell, *name, is_dont_delete)),
259 Code);
260 }
261
262
263 Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name, 249 Handle<Code> StubCache::ComputeLoadGlobal(Handle<String> name,
264 Handle<JSObject> receiver, 250 Handle<JSObject> receiver,
265 Handle<GlobalObject> holder, 251 Handle<GlobalObject> holder,
266 Handle<JSGlobalPropertyCell> cell, 252 Handle<JSGlobalPropertyCell> cell,
267 bool is_dont_delete) { 253 bool is_dont_delete) {
268 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP); 254 ASSERT(IC::GetCodeCacheForObject(*receiver, *holder) == OWN_MAP);
269 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL); 255 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::LOAD_IC, NORMAL);
270 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags)); 256 Handle<Object> probe(receiver->map()->FindInCodeCache(*name, flags));
271 if (probe->IsCode()) return Handle<Code>::cast(probe); 257 if (probe->IsCode()) return Handle<Code>::cast(probe);
272 258
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 StoreStubCompiler compiler(isolate_, strict_mode); 445 StoreStubCompiler compiler(isolate_, strict_mode);
460 Handle<Code> code = 446 Handle<Code> code =
461 compiler.CompileStoreField(receiver, field_index, transition, name); 447 compiler.CompileStoreField(receiver, field_index, transition, name);
462 PROFILE(isolate_, CodeCreateEvent(Logger::STORE_IC_TAG, *code, *name)); 448 PROFILE(isolate_, CodeCreateEvent(Logger::STORE_IC_TAG, *code, *name));
463 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code)); 449 GDBJIT(AddCode(GDBJITInterface::STORE_IC, *name, *code));
464 JSObject::UpdateMapCodeCache(receiver, name, code); 450 JSObject::UpdateMapCodeCache(receiver, name, code);
465 return code; 451 return code;
466 } 452 }
467 453
468 454
469 Handle<Code> KeyedLoadStubCompiler::CompileLoadElement(Handle<Map> map) {
470 CALL_HEAP_FUNCTION(isolate(),
471 (set_failure(NULL), CompileLoadElement(*map)),
472 Code);
473 }
474
475
476 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(Handle<Map> map) { 455 Handle<Code> KeyedStoreStubCompiler::CompileStoreElement(Handle<Map> map) {
477 CALL_HEAP_FUNCTION(isolate(), 456 CALL_HEAP_FUNCTION(isolate(),
478 (set_failure(NULL), 457 (set_failure(NULL),
479 CompileStoreElement(*map)), 458 CompileStoreElement(*map)),
480 Code); 459 Code);
481 } 460 }
482 461
483 462
484 Handle<Code> StubCache::ComputeKeyedLoadOrStoreElement( 463 Handle<Code> StubCache::ComputeKeyedLoadOrStoreElement(
485 Handle<JSObject> receiver, 464 Handle<JSObject> receiver,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 if (stub_kind == KeyedIC::LOAD) { 508 if (stub_kind == KeyedIC::LOAD) {
530 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, 0)); 509 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_LOAD_IC_TAG, *code, 0));
531 } else { 510 } else {
532 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_STORE_IC_TAG, *code, 0)); 511 PROFILE(isolate_, CodeCreateEvent(Logger::KEYED_STORE_IC_TAG, *code, 0));
533 } 512 }
534 JSObject::UpdateMapCodeCache(receiver, name, code); 513 JSObject::UpdateMapCodeCache(receiver, name, code);
535 return code; 514 return code;
536 } 515 }
537 516
538 517
539 Handle<Code> KeyedLoadStubCompiler::CompileLoadPolymorphic(
540 MapHandleList* receiver_maps,
541 CodeHandleList* handler_stubs) {
542 MapList raw_receiver_maps(receiver_maps->length());
543 CodeList raw_handler_stubs(handler_stubs->length());
544 CALL_HEAP_FUNCTION(
545 isolate(),
546 (set_failure(NULL),
547 raw_receiver_maps.Clear(),
548 raw_handler_stubs.Clear(),
549 CompileLoadPolymorphic(UnwrapHandleList(&raw_receiver_maps,
550 receiver_maps),
551 UnwrapHandleList(&raw_handler_stubs,
552 handler_stubs))),
553 Code);
554 }
555
556
557 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic( 518 Handle<Code> KeyedStoreStubCompiler::CompileStorePolymorphic(
558 MapHandleList* receiver_maps, 519 MapHandleList* receiver_maps,
559 CodeHandleList* handler_stubs, 520 CodeHandleList* handler_stubs,
560 MapHandleList* transitioned_maps) { 521 MapHandleList* transitioned_maps) {
561 MapList raw_receiver_maps(receiver_maps->length()); 522 MapList raw_receiver_maps(receiver_maps->length());
562 CodeList raw_handler_stubs(handler_stubs->length()); 523 CodeList raw_handler_stubs(handler_stubs->length());
563 MapList raw_transitioned_maps(transitioned_maps->length()); 524 MapList raw_transitioned_maps(transitioned_maps->length());
564 CALL_HEAP_FUNCTION( 525 CALL_HEAP_FUNCTION(
565 isolate(), 526 isolate(),
566 (set_failure(NULL), 527 (set_failure(NULL),
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 expected_receiver_type_ = 1838 expected_receiver_type_ =
1878 FunctionTemplateInfo::cast(signature->receiver()); 1839 FunctionTemplateInfo::cast(signature->receiver());
1879 } 1840 }
1880 } 1841 }
1881 1842
1882 is_simple_api_call_ = true; 1843 is_simple_api_call_ = true;
1883 } 1844 }
1884 1845
1885 1846
1886 } } // namespace v8::internal 1847 } } // namespace v8::internal
OLDNEW
« src/ia32/stub-cache-ia32.cc ('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