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

Side by Side Diff: src/ic.h

Issue 6879081: Added type recording for unary minus and unary bitwise negation. Note that the (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Hopefully final version of this patch... Created 9 years, 8 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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ICU(SharedStoreIC_ExtendStorage) \ 46 ICU(SharedStoreIC_ExtendStorage) \
47 ICU(KeyedStoreIC_Miss) \ 47 ICU(KeyedStoreIC_Miss) \
48 /* Utilities for IC stubs. */ \ 48 /* Utilities for IC stubs. */ \
49 ICU(LoadCallbackProperty) \ 49 ICU(LoadCallbackProperty) \
50 ICU(StoreCallbackProperty) \ 50 ICU(StoreCallbackProperty) \
51 ICU(LoadPropertyWithInterceptorOnly) \ 51 ICU(LoadPropertyWithInterceptorOnly) \
52 ICU(LoadPropertyWithInterceptorForLoad) \ 52 ICU(LoadPropertyWithInterceptorForLoad) \
53 ICU(LoadPropertyWithInterceptorForCall) \ 53 ICU(LoadPropertyWithInterceptorForCall) \
54 ICU(KeyedLoadPropertyWithInterceptor) \ 54 ICU(KeyedLoadPropertyWithInterceptor) \
55 ICU(StoreInterceptorProperty) \ 55 ICU(StoreInterceptorProperty) \
56 ICU(TypeRecordingUnaryOp_Patch) \
56 ICU(TypeRecordingBinaryOp_Patch) \ 57 ICU(TypeRecordingBinaryOp_Patch) \
57 ICU(CompareIC_Miss) 58 ICU(CompareIC_Miss)
58 // 59 //
59 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, 60 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC,
60 // and KeyedStoreIC. 61 // and KeyedStoreIC.
61 // 62 //
62 class IC { 63 class IC {
63 public: 64 public:
64 65
65 // The ids for utility called from the generated code. 66 // The ids for utility called from the generated code.
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 return isolate()->builtins()->builtin( 523 return isolate()->builtins()->builtin(
523 Builtins::kKeyedStoreIC_Generic_Strict); 524 Builtins::kKeyedStoreIC_Generic_Strict);
524 } 525 }
525 526
526 static void Clear(Address address, Code* target); 527 static void Clear(Address address, Code* target);
527 528
528 friend class IC; 529 friend class IC;
529 }; 530 };
530 531
531 532
533 class TRUnaryOpIC: public IC {
534 public:
535
536 // sorted: increasingly more unspecific (ignoring UNINITIALIZED)
537 // TODO(svenpanne) Using enums+switch is an antipattern, use a class instead.
538 enum TypeInfo {
539 UNINITIALIZED,
540 SMI,
541 HEAP_NUMBER,
542 GENERIC
543 };
544
545 explicit TRUnaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { }
546
547 void patch(Code* code);
548
549 static const char* GetName(TypeInfo type_info);
550
551 static State ToState(TypeInfo type_info);
552
553 static TypeInfo GetTypeInfo(Handle<Object> operand);
554
555 static TypeInfo JoinTypes(TypeInfo x, TypeInfo y);
556 };
557
558
532 // Type Recording BinaryOpIC, that records the types of the inputs and outputs. 559 // Type Recording BinaryOpIC, that records the types of the inputs and outputs.
533 class TRBinaryOpIC: public IC { 560 class TRBinaryOpIC: public IC {
534 public: 561 public:
535 562
536 enum TypeInfo { 563 enum TypeInfo {
537 UNINITIALIZED, 564 UNINITIALIZED,
538 SMI, 565 SMI,
539 INT32, 566 INT32,
540 HEAP_NUMBER, 567 HEAP_NUMBER,
541 ODDBALL, 568 ODDBALL,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 622
596 Token::Value op_; 623 Token::Value op_;
597 }; 624 };
598 625
599 // Helper for TRBinaryOpIC and CompareIC. 626 // Helper for TRBinaryOpIC and CompareIC.
600 void PatchInlinedSmiCode(Address address); 627 void PatchInlinedSmiCode(Address address);
601 628
602 } } // namespace v8::internal 629 } } // namespace v8::internal
603 630
604 #endif // V8_IC_H_ 631 #endif // V8_IC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698