OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 #include <limits.h> | 5 #include <limits.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "include/v8.h" | 9 #include "include/v8.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 v8::internal::Factory* factory = i_isolate->factory(); | 28 v8::internal::Factory* factory = i_isolate->factory(); |
29 | 29 |
30 if (size > INT_MAX) return 0; | 30 if (size > INT_MAX) return 0; |
31 v8::internal::MaybeHandle<v8::internal::String> source = | 31 v8::internal::MaybeHandle<v8::internal::String> source = |
32 factory->NewStringFromOneByte( | 32 factory->NewStringFromOneByte( |
33 v8::internal::Vector<const uint8_t>(data, static_cast<int>(size))); | 33 v8::internal::Vector<const uint8_t>(data, static_cast<int>(size))); |
34 if (source.is_null()) return 0; | 34 if (source.is_null()) return 0; |
35 | 35 |
36 v8::internal::Handle<v8::internal::Script> script = | 36 v8::internal::Handle<v8::internal::Script> script = |
37 factory->NewScript(source.ToHandleChecked()); | 37 factory->NewScript(source.ToHandleChecked()); |
38 v8::internal::ParseInfo info(script); | 38 v8::internal::Zone zone(i_isolate->allocator(), ZONE_NAME); |
| 39 v8::internal::ParseInfo info(&zone, script); |
39 v8::internal::parsing::ParseProgram(&info); | 40 v8::internal::parsing::ParseProgram(&info); |
40 isolate->RequestGarbageCollectionForTesting( | 41 isolate->RequestGarbageCollectionForTesting( |
41 v8::Isolate::kFullGarbageCollection); | 42 v8::Isolate::kFullGarbageCollection); |
42 return 0; | 43 return 0; |
43 } | 44 } |
OLD | NEW |