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

Side by Side Diff: src/bootstrapper.h

Issue 210143002: Revert "No longer OOM on invalid string length." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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/api.cc ('k') | 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698