| OLD | NEW |
| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) { | 67 void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) { |
| 68 Isolate* isolate = shared->GetIsolate(); | 68 Isolate* isolate = shared->GetIsolate(); |
| 69 Factory* factory = isolate->factory(); | 69 Factory* factory = isolate->factory(); |
| 70 HandleScope scope(isolate); | 70 HandleScope scope(isolate); |
| 71 int length = cache_->length(); | 71 int length = cache_->length(); |
| 72 Handle<FixedArray> new_array = factory->NewFixedArray(length + 2, TENURED); | 72 Handle<FixedArray> new_array = factory->NewFixedArray(length + 2, TENURED); |
| 73 cache_->CopyTo(0, *new_array, 0, cache_->length()); | 73 cache_->CopyTo(0, *new_array, 0, cache_->length()); |
| 74 cache_ = *new_array; | 74 cache_ = *new_array; |
| 75 Handle<String> str = factory->NewStringFromAscii(name, TENURED); | 75 Handle<String> str = factory->NewStringFromAscii(name, TENURED); |
| 76 ASSERT(!str.is_null()); | |
| 77 cache_->set(length, *str); | 76 cache_->set(length, *str); |
| 78 cache_->set(length + 1, *shared); | 77 cache_->set(length + 1, *shared); |
| 79 Script::cast(shared->script())->set_type(Smi::FromInt(type_)); | 78 Script::cast(shared->script())->set_type(Smi::FromInt(type_)); |
| 80 } | 79 } |
| 81 | 80 |
| 82 private: | 81 private: |
| 83 Script::Type type_; | 82 Script::Type type_; |
| 84 FixedArray* cache_; | 83 FixedArray* cache_; |
| 85 DISALLOW_COPY_AND_ASSIGN(SourceCodeCache); | 84 DISALLOW_COPY_AND_ASSIGN(SourceCodeCache); |
| 86 }; | 85 }; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 return length_; | 190 return length_; |
| 192 } | 191 } |
| 193 private: | 192 private: |
| 194 const char* data_; | 193 const char* data_; |
| 195 size_t length_; | 194 size_t length_; |
| 196 }; | 195 }; |
| 197 | 196 |
| 198 }} // namespace v8::internal | 197 }} // namespace v8::internal |
| 199 | 198 |
| 200 #endif // V8_BOOTSTRAPPER_H_ | 199 #endif // V8_BOOTSTRAPPER_H_ |
| OLD | NEW |