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

Side by Side Diff: src/bootstrapper.h

Issue 23708030: Get rid of most uses of 'Temporary macro' HEAP (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: nits 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 | « src/ast.cc ('k') | src/builtins.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 27 matching lines...) Expand all
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(bool create_heap_objects) {
48 cache_ = create_heap_objects ? HEAP->empty_fixed_array() : NULL; 48 cache_ = create_heap_objects ?
49 Isolate::Current()->heap()->empty_fixed_array() : NULL;
49 } 50 }
50 51
51 void Iterate(ObjectVisitor* v) { 52 void Iterate(ObjectVisitor* v) {
52 v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_)); 53 v->VisitPointer(BitCast<Object**, FixedArray**>(&cache_));
53 } 54 }
54 55
55 bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) { 56 bool Lookup(Vector<const char> name, Handle<SharedFunctionInfo>* handle) {
56 for (int i = 0; i < cache_->length(); i+=2) { 57 for (int i = 0; i < cache_->length(); i+=2) {
57 SeqOneByteString* str = SeqOneByteString::cast(cache_->get(i)); 58 SeqOneByteString* str = SeqOneByteString::cast(cache_->get(i));
58 if (str->IsUtf8EqualTo(name)) { 59 if (str->IsUtf8EqualTo(name)) {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return length_; 187 return length_;
187 } 188 }
188 private: 189 private:
189 const char* data_; 190 const char* data_;
190 size_t length_; 191 size_t length_;
191 }; 192 };
192 193
193 }} // namespace v8::internal 194 }} // namespace v8::internal
194 195
195 #endif // V8_BOOTSTRAPPER_H_ 196 #endif // V8_BOOTSTRAPPER_H_
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698