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

Side by Side Diff: bleeding_edge/src/ic.h

Issue 491075: Try to make the contextuality check in the IC code faster... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years 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 | « no previous file | bleeding_edge/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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // Clear the inline cache to initial state. 97 // Clear the inline cache to initial state.
98 static void Clear(Address address); 98 static void Clear(Address address);
99 99
100 // Computes the reloc info for this IC. This is a fairly expensive 100 // Computes the reloc info for this IC. This is a fairly expensive
101 // operation as it has to search through the heap to find the code 101 // operation as it has to search through the heap to find the code
102 // object that contains this IC site. 102 // object that contains this IC site.
103 RelocInfo::Mode ComputeMode(); 103 RelocInfo::Mode ComputeMode();
104 104
105 // Returns if this IC is for contextual (no explicit receiver) 105 // Returns if this IC is for contextual (no explicit receiver)
106 // access to properties. 106 // access to properties.
107 bool is_contextual() { 107 bool IsContextual(Handle<Object> receiver) {
108 if (receiver->IsGlobalObject()) {
109 return SlowIsContextual();
110 } else {
111 ASSERT(!SlowIsContextual());
112 return false;
113 }
114 }
115
116 bool SlowIsContextual() {
108 return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT; 117 return ComputeMode() == RelocInfo::CODE_TARGET_CONTEXT;
109 } 118 }
110 119
111 // Returns the map to use for caching stubs for a given object. 120 // Returns the map to use for caching stubs for a given object.
112 // This method should not be called with undefined or null. 121 // This method should not be called with undefined or null.
113 static inline Map* GetCodeCacheMapForObject(Object* object); 122 static inline Map* GetCodeCacheMapForObject(Object* object);
114 123
115 protected: 124 protected:
116 Address fp() const { return fp_; } 125 Address fp() const { return fp_; }
117 Address pc() const { return *pc_address_; } 126 Address pc() const { return *pc_address_; }
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 // The map is the new map that the inlined code should check against. 425 // The map is the new map that the inlined code should check against.
417 static bool PatchInlinedStore(Address address, Object* map); 426 static bool PatchInlinedStore(Address address, Object* map);
418 427
419 friend class IC; 428 friend class IC;
420 }; 429 };
421 430
422 431
423 } } // namespace v8::internal 432 } } // namespace v8::internal
424 433
425 #endif // V8_IC_H_ 434 #endif // V8_IC_H_
OLDNEW
« no previous file with comments | « no previous file | bleeding_edge/src/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698