OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 static inline v8::Local<v8::Value> CompileRun(const char* source) { | 364 static inline v8::Local<v8::Value> CompileRun(const char* source) { |
365 return v8::Script::Compile(v8_str(source))->Run(); | 365 return v8::Script::Compile(v8_str(source))->Run(); |
366 } | 366 } |
367 | 367 |
368 | 368 |
369 static inline v8::Local<v8::Value> CompileRun(v8::Local<v8::String> source) { | 369 static inline v8::Local<v8::Value> CompileRun(v8::Local<v8::String> source) { |
370 return v8::Script::Compile(source)->Run(); | 370 return v8::Script::Compile(source)->Run(); |
371 } | 371 } |
372 | 372 |
373 | 373 |
374 static inline v8::Local<v8::Value> PreCompileCompileRun(const char* source) { | 374 static inline v8::Local<v8::Value> ParserCacheCompileRun(const char* source) { |
375 // Compile once just to get the preparse data, then compile the second time | 375 // Compile once just to get the preparse data, then compile the second time |
376 // using the data. | 376 // using the data. |
377 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 377 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
378 v8::ScriptCompiler::Source script_source(v8_str(source)); | 378 v8::ScriptCompiler::Source script_source(v8_str(source)); |
379 v8::ScriptCompiler::Compile(isolate, &script_source, | 379 v8::ScriptCompiler::Compile(isolate, &script_source, |
380 v8::ScriptCompiler::kProduceDataToCache); | 380 v8::ScriptCompiler::kProduceParserCache); |
381 return v8::ScriptCompiler::Compile(isolate, &script_source)->Run(); | 381 return v8::ScriptCompiler::Compile(isolate, &script_source, |
| 382 v8::ScriptCompiler::kConsumeParserCache) |
| 383 ->Run(); |
382 } | 384 } |
383 | 385 |
384 | 386 |
385 // Helper functions that compile and run the source with given origin. | 387 // Helper functions that compile and run the source with given origin. |
386 static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source, | 388 static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source, |
387 const char* origin_url, | 389 const char* origin_url, |
388 int line_number, | 390 int line_number, |
389 int column_number) { | 391 int column_number) { |
390 v8::Isolate* isolate = v8::Isolate::GetCurrent(); | 392 v8::Isolate* isolate = v8::Isolate::GetCurrent(); |
391 v8::ScriptOrigin origin(v8_str(origin_url), | 393 v8::ScriptOrigin origin(v8_str(origin_url), |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects()); | 496 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects()); |
495 heap_profiler_->StopHeapObjectsTracking(); | 497 heap_profiler_->StopHeapObjectsTracking(); |
496 } | 498 } |
497 | 499 |
498 private: | 500 private: |
499 i::HeapProfiler* heap_profiler_; | 501 i::HeapProfiler* heap_profiler_; |
500 }; | 502 }; |
501 | 503 |
502 | 504 |
503 #endif // ifndef CCTEST_H_ | 505 #endif // ifndef CCTEST_H_ |
OLD | NEW |