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

Side by Side Diff: src/ic.h

Issue 844006: Merge changes up to V8 version 2.1.3 into the partial snapshots (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 9 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/ia32/virtual-frame-ia32.cc ('k') | src/ic.cc » ('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 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ICU(StoreIC_ArrayLength) \ 48 ICU(StoreIC_ArrayLength) \
49 ICU(SharedStoreIC_ExtendStorage) \ 49 ICU(SharedStoreIC_ExtendStorage) \
50 ICU(KeyedStoreIC_Miss) \ 50 ICU(KeyedStoreIC_Miss) \
51 /* Utilities for IC stubs. */ \ 51 /* Utilities for IC stubs. */ \
52 ICU(LoadCallbackProperty) \ 52 ICU(LoadCallbackProperty) \
53 ICU(StoreCallbackProperty) \ 53 ICU(StoreCallbackProperty) \
54 ICU(LoadPropertyWithInterceptorOnly) \ 54 ICU(LoadPropertyWithInterceptorOnly) \
55 ICU(LoadPropertyWithInterceptorForLoad) \ 55 ICU(LoadPropertyWithInterceptorForLoad) \
56 ICU(LoadPropertyWithInterceptorForCall) \ 56 ICU(LoadPropertyWithInterceptorForCall) \
57 ICU(KeyedLoadPropertyWithInterceptor) \ 57 ICU(KeyedLoadPropertyWithInterceptor) \
58 ICU(StoreInterceptorProperty) 58 ICU(StoreInterceptorProperty) \
59 ICU(BinaryOp_Patch)
59 60
60 // 61 //
61 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC, 62 // IC is the base class for LoadIC, StoreIC, CallIC, KeyedLoadIC,
62 // and KeyedStoreIC. 63 // and KeyedStoreIC.
63 // 64 //
64 class IC { 65 class IC {
65 public: 66 public:
66 67
67 // The ids for utility called from the generated code. 68 // The ids for utility called from the generated code.
68 enum UtilityId { 69 enum UtilityId {
(...skipping 17 matching lines...) Expand all
86 }; 87 };
87 88
88 // Construct the IC structure with the given number of extra 89 // Construct the IC structure with the given number of extra
89 // JavaScript frames on the stack. 90 // JavaScript frames on the stack.
90 explicit IC(FrameDepth depth); 91 explicit IC(FrameDepth depth);
91 92
92 // Get the call-site target; used for determining the state. 93 // Get the call-site target; used for determining the state.
93 Code* target() { return GetTargetAtAddress(address()); } 94 Code* target() { return GetTargetAtAddress(address()); }
94 inline Address address(); 95 inline Address address();
95 96
96 // Compute the current IC state based on the target stub and the receiver. 97 // Compute the current IC state based on the target stub, receiver and name.
97 static State StateFrom(Code* target, Object* receiver); 98 static State StateFrom(Code* target, Object* receiver, Object* name);
98 99
99 // Clear the inline cache to initial state. 100 // Clear the inline cache to initial state.
100 static void Clear(Address address); 101 static void Clear(Address address);
101 102
102 // Computes the reloc info for this IC. This is a fairly expensive 103 // Computes the reloc info for this IC. This is a fairly expensive
103 // operation as it has to search through the heap to find the code 104 // operation as it has to search through the heap to find the code
104 // object that contains this IC site. 105 // object that contains this IC site.
105 RelocInfo::Mode ComputeMode(); 106 RelocInfo::Mode ComputeMode();
106 107
107 // Returns if this IC is for contextual (no explicit receiver) 108 // Returns if this IC is for contextual (no explicit receiver)
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // The address is the patch point for the IC call 438 // The address is the patch point for the IC call
438 // (Assembler::kCallTargetAddressOffset before the end of 439 // (Assembler::kCallTargetAddressOffset before the end of
439 // the call/return address). 440 // the call/return address).
440 // The map is the new map that the inlined code should check against. 441 // The map is the new map that the inlined code should check against.
441 static bool PatchInlinedStore(Address address, Object* map); 442 static bool PatchInlinedStore(Address address, Object* map);
442 443
443 friend class IC; 444 friend class IC;
444 }; 445 };
445 446
446 447
448 class BinaryOpIC: public IC {
449 public:
450
451 enum TypeInfo {
452 DEFAULT, // Initial state. When first executed, patches to one
453 // of the following states depending on the operands types.
454 HEAP_NUMBERS, // Both arguments are HeapNumbers.
455 STRINGS, // At least one of the arguments is String.
456 GENERIC // Non-specialized case (processes any type combination).
457 };
458
459 BinaryOpIC() : IC(NO_EXTRA_FRAME) { }
460
461 void patch(Code* code);
462
463 static void Clear(Address address, Code* target);
464
465 static const char* GetName(TypeInfo type_info);
466
467 static State ToState(TypeInfo type_info);
468
469 static TypeInfo GetTypeInfo(Object* left, Object* right);
470 };
471
447 } } // namespace v8::internal 472 } } // namespace v8::internal
448 473
449 #endif // V8_IC_H_ 474 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « src/ia32/virtual-frame-ia32.cc ('k') | src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698