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

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

Issue 12209021: Refactor LoadIC into Handler Frontend and Backends. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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
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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 friend class SCTableReference; 394 friend class SCTableReference;
395 395
396 DISALLOW_COPY_AND_ASSIGN(StubCache); 396 DISALLOW_COPY_AND_ASSIGN(StubCache);
397 }; 397 };
398 398
399 399
400 // ------------------------------------------------------------------------ 400 // ------------------------------------------------------------------------
401 401
402 402
403 // Support functions for IC stubs for callbacks. 403 // Support functions for IC stubs for callbacks.
404 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadCallbackProperty);
405 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty); 404 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreCallbackProperty);
406 405
407 406
408 // Support functions for IC stubs for interceptors. 407 // Support functions for IC stubs for interceptors.
409 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly); 408 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorOnly);
410 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForLoad); 409 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForLoad);
411 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForCall); 410 DECLARE_RUNTIME_FUNCTION(MaybeObject*, LoadPropertyWithInterceptorForCall);
412 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty); 411 DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreInterceptorProperty);
413 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CallInterceptorProperty); 412 DECLARE_RUNTIME_FUNCTION(MaybeObject*, CallInterceptorProperty);
414 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor); 413 DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedLoadPropertyWithInterceptor);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 Label* miss); 527 Label* miss);
529 528
530 529
531 protected: 530 protected:
532 Handle<Code> GetCodeWithFlags(Code::Flags flags, const char* name); 531 Handle<Code> GetCodeWithFlags(Code::Flags flags, const char* name);
533 Handle<Code> GetCodeWithFlags(Code::Flags flags, Handle<String> name); 532 Handle<Code> GetCodeWithFlags(Code::Flags flags, Handle<String> name);
534 533
535 MacroAssembler* masm() { return &masm_; } 534 MacroAssembler* masm() { return &masm_; }
536 void set_failure(Failure* failure) { failure_ = failure; } 535 void set_failure(Failure* failure) { failure_ = failure; }
537 536
538 void GenerateLoadField(Handle<JSObject> object,
539 Handle<JSObject> holder,
540 Register receiver,
541 Register scratch1,
542 Register scratch2,
543 Register scratch3,
544 PropertyIndex index,
545 Handle<String> name,
546 Label* miss);
547
548 void GenerateLoadCallback(Handle<JSObject> object,
549 Handle<JSObject> holder,
550 Register receiver,
551 Register name_reg,
552 Register scratch1,
553 Register scratch2,
554 Register scratch3,
555 Register scratch4,
556 Handle<AccessorInfo> callback,
557 Handle<String> name,
558 Label* miss);
559
560 void GenerateDictionaryLoadCallback(Register receiver,
561 Register name_reg,
562 Register scratch1,
563 Register scratch2,
564 Register scratch3,
565 Handle<AccessorInfo> callback,
566 Handle<String> name,
567 Label* miss);
568
569 void GenerateLoadConstant(Handle<JSObject> object,
570 Handle<JSObject> holder,
571 Register receiver,
572 Register scratch1,
573 Register scratch2,
574 Register scratch3,
575 Handle<JSFunction> value,
576 Handle<String> name,
577 Label* miss);
578
579 void GenerateLoadInterceptor(Handle<JSObject> object,
580 Handle<JSObject> holder,
581 LookupResult* lookup,
582 Register receiver,
583 Register name_reg,
584 Register scratch1,
585 Register scratch2,
586 Register scratch3,
587 Handle<String> name,
588 Label* miss);
589
590 static void LookupPostInterceptor(Handle<JSObject> holder, 537 static void LookupPostInterceptor(Handle<JSObject> holder,
591 Handle<String> name, 538 Handle<String> name,
592 LookupResult* lookup); 539 LookupResult* lookup);
593 540
594 Isolate* isolate() { return isolate_; } 541 Isolate* isolate() { return isolate_; }
595 Heap* heap() { return isolate()->heap(); } 542 Heap* heap() { return isolate()->heap(); }
596 Factory* factory() { return isolate()->factory(); } 543 Factory* factory() { return isolate()->factory(); }
597 544
598 private: 545 private:
599 Isolate* isolate_; 546 Isolate* isolate_;
(...skipping 21 matching lines...) Expand all
621 Handle<Code> CompileLoadConstant(Handle<JSObject> object, 568 Handle<Code> CompileLoadConstant(Handle<JSObject> object,
622 Handle<JSObject> holder, 569 Handle<JSObject> holder,
623 Handle<String> name, 570 Handle<String> name,
624 Handle<JSFunction> value); 571 Handle<JSFunction> value);
625 572
626 Handle<Code> CompileLoadInterceptor(Handle<JSObject> object, 573 Handle<Code> CompileLoadInterceptor(Handle<JSObject> object,
627 Handle<JSObject> holder, 574 Handle<JSObject> holder,
628 Handle<String> name); 575 Handle<String> name);
629 576
630 protected: 577 protected:
578 Register GenerateHandlerFrontend(Handle<JSObject> object,
579 Register object_reg,
580 Handle<JSObject> holder,
581 Handle<String> name,
582 Label* success,
583 Handle<AccessorInfo> callback,
584 bool perform_initial_checks);
Jakob Kummerow 2013/02/06 12:48:27 Let's use a two-value enum here to add a bit of cl
585
586 void GenerateLoadField(Register reg,
587 Handle<JSObject> holder,
588 PropertyIndex index);
589 void GenerateLoadConstant(Handle<JSFunction> value);
590 void GenerateLoadCallback(Register reg, Handle<AccessorInfo> callback);
591 void GenerateLoadInterceptor(Register holder_reg,
592 Handle<JSObject> object,
593 Handle<JSObject> holder,
594 LookupResult* lookup,
595 Handle<String> name);
596 void GenerateLoadPostInterceptor(Register reg,
597 Handle<JSObject> interceptor_holder,
598 Handle<String> name,
599 LookupResult* lookup);
600
601
631 Register receiver() { return registers_[0]; } 602 Register receiver() { return registers_[0]; }
632 Register name() { return registers_[1]; } 603 Register name() { return registers_[1]; }
633 Register scratch1() { return registers_[2]; } 604 Register scratch1() { return registers_[2]; }
634 Register scratch2() { return registers_[3]; } 605 Register scratch2() { return registers_[3]; }
635 Register scratch3() { return registers_[4]; } 606 Register scratch3() { return registers_[4]; }
636 Register scratch4() { return registers_[5]; } 607 Register scratch4() { return registers_[5]; }
637 608
638 private: 609 private:
610 void GenerateDictionaryLoadCallback(Register reg,
611 Handle<AccessorInfo> callback,
612 Label* miss);
639 virtual Code::Kind kind() = 0; 613 virtual Code::Kind kind() = 0;
640 virtual void GenerateNameCheck(Handle<String> name, 614 virtual void GenerateNameCheck(Handle<String> name,
641 Register name_reg, 615 Register name_reg,
642 Label* miss) { } 616 Label* miss) { }
643 virtual Handle<Code> GetCode(Code::StubType type, 617 virtual Handle<Code> GetCode(Code::StubType type,
644 Handle<String> name, 618 Handle<String> name,
645 InlineCacheState state = MONOMORPHIC) = 0; 619 InlineCacheState state = MONOMORPHIC) = 0;
646 Register* registers_; 620 Register* registers_;
647 }; 621 };
648 622
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 Handle<JSFunction> constant_function_; 927 Handle<JSFunction> constant_function_;
954 bool is_simple_api_call_; 928 bool is_simple_api_call_;
955 Handle<FunctionTemplateInfo> expected_receiver_type_; 929 Handle<FunctionTemplateInfo> expected_receiver_type_;
956 Handle<CallHandlerInfo> api_call_info_; 930 Handle<CallHandlerInfo> api_call_info_;
957 }; 931 };
958 932
959 933
960 } } // namespace v8::internal 934 } } // namespace v8::internal
961 935
962 #endif // V8_STUB_CACHE_H_ 936 #endif // V8_STUB_CACHE_H_
OLDNEW
« src/ia32/stub-cache-ia32.cc ('K') | « src/ic.h ('k') | src/stub-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698