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

Side by Side Diff: src/bootstrapper.h

Issue 23494046: some random isolate threading (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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 | « no previous file | src/bootstrapper.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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 26 matching lines...) Expand all
37 37
38 // A SourceCodeCache uses a FixedArray to store pairs of 38 // A SourceCodeCache uses a FixedArray to store pairs of
39 // (AsciiString*, JSFunction*), mapping names of native code files 39 // (AsciiString*, JSFunction*), mapping names of native code files
40 // (runtime.js, etc.) to precompiled functions. Instead of mapping 40 // (runtime.js, etc.) to precompiled functions. Instead of mapping
41 // names to functions it might make sense to let the JS2C tool 41 // names to functions it might make sense to let the JS2C tool
42 // generate an index for each native JS file. 42 // generate an index for each native JS file.
43 class SourceCodeCache BASE_EMBEDDED { 43 class SourceCodeCache BASE_EMBEDDED {
44 public: 44 public:
45 explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { } 45 explicit SourceCodeCache(Script::Type type): type_(type), cache_(NULL) { }
46 46
47 void Initialize(bool create_heap_objects) { 47 void Initialize(Isolate* isolate, bool create_heap_objects) {
48 cache_ = create_heap_objects ? 48 cache_ = create_heap_objects ? isolate->heap()->empty_fixed_array() : NULL;
49 Isolate::Current()->heap()->empty_fixed_array() : NULL;
50 } 49 }
51 50
52 void Iterate(ObjectVisitor* v) { 51 void Iterate(ObjectVisitor* v) {
53 v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_)); 52 v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_));
54 } 53 }
55 54
56 bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) { 55 bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) {
57 for (int i = 0; i < cache_->length(); i+=2) { 56 for (int i = 0; i < cache_->length(); i+=2) {
58 SeqOneByteString* str = SeqOneByteString::cast(cache_->get(i)); 57 SeqOneByteString* str = SeqOneByteString::cast(cache_->get(i));
59 if (str->IsUtf8EqualTo(name)) { 58 if (str->IsUtf8EqualTo(name)) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 return length_; 186 return length_;
188 } 187 }
189 private: 188 private:
190 const char* data_; 189 const char* data_;
191 size_t length_; 190 size_t length_;
192 }; 191 };
193 192
194 }} // namespace v8::internal 193 }} // namespace v8::internal
195 194
196 #endif // V8_BOOTSTRAPPER_H_ 195 #endif // V8_BOOTSTRAPPER_H_
OLDNEW
« no previous file with comments | « no previous file | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698