OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 break; | 86 break; |
87 } | 87 } |
88 case LATIN1: { | 88 case LATIN1: { |
89 StringResource8* string_resource = | 89 StringResource8* string_resource = |
90 new StringResource8(reinterpret_cast<const char*>(source), length); | 90 new StringResource8(reinterpret_cast<const char*>(source), length); |
91 source_handle = v8::String::NewExternal(isolate, string_resource); | 91 source_handle = v8::String::NewExternal(isolate, string_resource); |
92 break; | 92 break; |
93 } | 93 } |
94 } | 94 } |
95 v8::base::TimeDelta parse_time1, parse_time2; | 95 v8::base::TimeDelta parse_time1, parse_time2; |
96 Handle<Script> script = Isolate::Current()->factory()->NewScript( | 96 Handle<Script> script = |
97 v8::Utils::OpenHandle(*source_handle)); | 97 reinterpret_cast<i::Isolate*>(isolate)->factory()->NewScript( |
| 98 v8::Utils::OpenHandle(*source_handle)); |
98 i::ScriptData* cached_data_impl = NULL; | 99 i::ScriptData* cached_data_impl = NULL; |
99 // First round of parsing (produce data to cache). | 100 // First round of parsing (produce data to cache). |
100 { | 101 { |
101 Zone zone; | 102 Zone zone; |
102 ParseInfo info(&zone, script); | 103 ParseInfo info(&zone, script); |
103 info.set_global(); | 104 info.set_global(); |
104 info.set_cached_data(&cached_data_impl); | 105 info.set_cached_data(&cached_data_impl); |
105 info.set_compile_options(v8::ScriptCompiler::kProduceParserCache); | 106 info.set_compile_options(v8::ScriptCompiler::kProduceParserCache); |
106 v8::base::ElapsedTimer timer; | 107 v8::base::ElapsedTimer timer; |
107 timer.Start(); | 108 timer.Start(); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 first_parse_total); | 189 first_parse_total); |
189 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), | 190 printf("%s(SecondParseRunTime): %.f ms\n", benchmark.c_str(), |
190 second_parse_total); | 191 second_parse_total); |
191 } | 192 } |
192 } | 193 } |
193 v8::V8::Dispose(); | 194 v8::V8::Dispose(); |
194 v8::V8::ShutdownPlatform(); | 195 v8::V8::ShutdownPlatform(); |
195 delete platform; | 196 delete platform; |
196 return 0; | 197 return 0; |
197 } | 198 } |
OLD | NEW |