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

Side by Side Diff: src/bootstrapper.h

Issue 2759513002: Remove Factory::NewStringFromASCII method. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | src/factory.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_BOOTSTRAPPER_H_ 5 #ifndef V8_BOOTSTRAPPER_H_
6 #define V8_BOOTSTRAPPER_H_ 6 #define V8_BOOTSTRAPPER_H_
7 7
8 #include "src/factory.h" 8 #include "src/factory.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 30 matching lines...) Expand all
41 41
42 void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) { 42 void Add(Vector<const char> name, Handle<SharedFunctionInfo> shared) {
43 Isolate* isolate = shared->GetIsolate(); 43 Isolate* isolate = shared->GetIsolate();
44 Factory* factory = isolate->factory(); 44 Factory* factory = isolate->factory();
45 HandleScope scope(isolate); 45 HandleScope scope(isolate);
46 int length = cache_->length(); 46 int length = cache_->length();
47 Handle<FixedArray> new_array = factory->NewFixedArray(length + 2, TENURED); 47 Handle<FixedArray> new_array = factory->NewFixedArray(length + 2, TENURED);
48 cache_->CopyTo(0, *new_array, 0, cache_->length()); 48 cache_->CopyTo(0, *new_array, 0, cache_->length());
49 cache_ = *new_array; 49 cache_ = *new_array;
50 Handle<String> str = 50 Handle<String> str =
51 factory->NewStringFromAscii(name, TENURED).ToHandleChecked(); 51 factory
52 ->NewStringFromOneByte(Vector<const uint8_t>::cast(name), TENURED)
53 .ToHandleChecked();
52 DCHECK(!str.is_null()); 54 DCHECK(!str.is_null());
53 cache_->set(length, *str); 55 cache_->set(length, *str);
54 cache_->set(length + 1, *shared); 56 cache_->set(length + 1, *shared);
55 Script::cast(shared->script())->set_type(type_); 57 Script::cast(shared->script())->set_type(type_);
56 } 58 }
57 59
58 private: 60 private:
59 Script::Type type_; 61 Script::Type type_;
60 FixedArray* cache_; 62 FixedArray* cache_;
61 DISALLOW_COPY_AND_ASSIGN(SourceCodeCache); 63 DISALLOW_COPY_AND_ASSIGN(SourceCodeCache);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 174
173 private: 175 private:
174 const char* data_; 176 const char* data_;
175 size_t length_; 177 size_t length_;
176 }; 178 };
177 179
178 } // namespace internal 180 } // namespace internal
179 } // namespace v8 181 } // namespace v8
180 182
181 #endif // V8_BOOTSTRAPPER_H_ 183 #endif // V8_BOOTSTRAPPER_H_
OLDNEW
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698