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

Side by Side Diff: src/objects.h

Issue 224733022: Handlify CompilationCache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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
« no previous file with comments | « src/jsregexp.cc ('k') | src/objects.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 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 8166 matching lines...) Expand 10 before | Expand all | Expand 10 after
8177 8177
8178 static const int kPrefixSize = 0; 8178 static const int kPrefixSize = 0;
8179 static const int kEntrySize = 2; 8179 static const int kEntrySize = 2;
8180 }; 8180 };
8181 8181
8182 8182
8183 class CompilationCacheTable: public HashTable<CompilationCacheShape, 8183 class CompilationCacheTable: public HashTable<CompilationCacheShape,
8184 HashTableKey*> { 8184 HashTableKey*> {
8185 public: 8185 public:
8186 // Find cached value for a string key, otherwise return null. 8186 // Find cached value for a string key, otherwise return null.
8187 Object* Lookup(String* src, Context* context); 8187 Handle<Object> Lookup(Handle<String> src, Handle<Context> context);
8188 Object* LookupEval(String* src, 8188 Handle<Object> LookupEval(Handle<String> src, Handle<Context> context,
8189 Context* context, 8189 StrictMode strict_mode, int scope_position);
8190 StrictMode strict_mode, 8190 Handle<Object> LookupRegExp(Handle<String> source, JSRegExp::Flags flags);
8191 int scope_position); 8191 static Handle<CompilationCacheTable> Put(
8192 Object* LookupRegExp(String* source, JSRegExp::Flags flags); 8192 Handle<CompilationCacheTable> cache, Handle<String> src,
8193 MUST_USE_RESULT MaybeObject* Put(String* src, 8193 Handle<Context> context, Handle<Object> value);
8194 Context* context, 8194 static Handle<CompilationCacheTable> PutEval(
8195 Object* value); 8195 Handle<CompilationCacheTable> cache, Handle<String> src,
8196 MUST_USE_RESULT MaybeObject* PutEval(String* src, 8196 Handle<Context> context, Handle<SharedFunctionInfo> value,
8197 Context* context, 8197 int scope_position);
8198 SharedFunctionInfo* value, 8198 static Handle<CompilationCacheTable> PutRegExp(
8199 int scope_position); 8199 Handle<CompilationCacheTable> cache, Handle<String> src,
8200 MUST_USE_RESULT MaybeObject* PutRegExp(String* src, 8200 JSRegExp::Flags flags, Handle<FixedArray> value);
8201 JSRegExp::Flags flags, 8201 static Handle<CompilationCacheTable> EnsureCapacityFor(
8202 FixedArray* value); 8202 Handle<CompilationCacheTable> cache, int n, HashTableKey* key);
8203
8204 // Remove given value from cache.
8205 void Remove(Object* value); 8203 void Remove(Object* value);
8206 8204
8207 static inline CompilationCacheTable* cast(Object* obj); 8205 static inline CompilationCacheTable* cast(Object* obj);
8208 8206
8209 private: 8207 private:
8210 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable); 8208 DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable);
8211 }; 8209 };
8212 8210
8213 8211
8214 class CodeCache: public Struct { 8212 class CodeCache: public Struct {
(...skipping 2775 matching lines...) Expand 10 before | Expand all | Expand 10 after
10990 } else { 10988 } else {
10991 value &= ~(1 << bit_position); 10989 value &= ~(1 << bit_position);
10992 } 10990 }
10993 return value; 10991 return value;
10994 } 10992 }
10995 }; 10993 };
10996 10994
10997 } } // namespace v8::internal 10995 } } // namespace v8::internal
10998 10996
10999 #endif // V8_OBJECTS_H_ 10997 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/jsregexp.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698