OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 HandlerFrontendHeader(Handle<JSObject> object, |
| 579 Register object_reg, |
| 580 Handle<JSObject> holder, |
| 581 Handle<String> name, |
| 582 Label* success, |
| 583 bool perform_initial_checks); |
| 584 void HandlerFrontendFooter(Label* success, Label* miss); |
| 585 |
| 586 Register HandlerFrontend(Handle<JSObject> object, |
| 587 Register object_reg, |
| 588 Handle<JSObject> holder, |
| 589 Handle<String> name, |
| 590 Label* success, |
| 591 bool perform_initial_checks); |
| 592 Register CallbackHandlerFrontend(Handle<JSObject> object, |
| 593 Register object_reg, |
| 594 Handle<JSObject> holder, |
| 595 Handle<String> name, |
| 596 Label* success, |
| 597 bool perform_initial_checks, |
| 598 Handle<AccessorInfo> callback); |
| 599 void NonexistentHandlerFrontend(Handle<JSObject> object, |
| 600 Handle<JSObject> last, |
| 601 Handle<String> name, |
| 602 Label* success, |
| 603 Handle<GlobalObject> global); |
| 604 |
| 605 void GenerateLoadField(Register reg, |
| 606 Handle<JSObject> holder, |
| 607 PropertyIndex index); |
| 608 void GenerateLoadConstant(Handle<JSFunction> value); |
| 609 void GenerateLoadCallback(Register reg, Handle<AccessorInfo> callback); |
| 610 void GenerateLoadInterceptor(Register holder_reg, |
| 611 Handle<JSObject> object, |
| 612 Handle<JSObject> holder, |
| 613 LookupResult* lookup, |
| 614 Handle<String> name); |
| 615 void GenerateLoadPostInterceptor(Register reg, |
| 616 Handle<JSObject> interceptor_holder, |
| 617 Handle<String> name, |
| 618 LookupResult* lookup); |
| 619 |
| 620 |
631 Register receiver() { return registers_[0]; } | 621 Register receiver() { return registers_[0]; } |
632 Register name() { return registers_[1]; } | 622 Register name() { return registers_[1]; } |
633 Register scratch1() { return registers_[2]; } | 623 Register scratch1() { return registers_[2]; } |
634 Register scratch2() { return registers_[3]; } | 624 Register scratch2() { return registers_[3]; } |
635 Register scratch3() { return registers_[4]; } | 625 Register scratch3() { return registers_[4]; } |
636 Register scratch4() { return registers_[5]; } | 626 Register scratch4() { return registers_[5]; } |
637 | 627 |
638 private: | 628 private: |
639 virtual Code::Kind kind() = 0; | 629 virtual Code::Kind kind() = 0; |
640 virtual void GenerateNameCheck(Handle<String> name, | 630 virtual void GenerateNameCheck(Handle<String> name, |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 Handle<JSFunction> constant_function_; | 943 Handle<JSFunction> constant_function_; |
954 bool is_simple_api_call_; | 944 bool is_simple_api_call_; |
955 Handle<FunctionTemplateInfo> expected_receiver_type_; | 945 Handle<FunctionTemplateInfo> expected_receiver_type_; |
956 Handle<CallHandlerInfo> api_call_info_; | 946 Handle<CallHandlerInfo> api_call_info_; |
957 }; | 947 }; |
958 | 948 |
959 | 949 |
960 } } // namespace v8::internal | 950 } } // namespace v8::internal |
961 | 951 |
962 #endif // V8_STUB_CACHE_H_ | 952 #endif // V8_STUB_CACHE_H_ |
OLD | NEW |