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

Side by Side Diff: test/cctest/cctest.h

Issue 181453002: Reset trunk to 3.24.35.4 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | « test/benchmarks/benchmarks.status ('k') | test/cctest/cctest.gyp » ('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 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 308 }
309 309
310 310
311 // Helper function that compiles and runs the source. 311 // Helper function that compiles and runs the source.
312 static inline v8::Local<v8::Value> CompileRun(const char* source) { 312 static inline v8::Local<v8::Value> CompileRun(const char* source) {
313 return v8::Script::Compile( 313 return v8::Script::Compile(
314 v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), source))->Run(); 314 v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), source))->Run();
315 } 315 }
316 316
317 317
318 static inline v8::Local<v8::Value> PreCompileCompileRun(const char* source) {
319 v8::Local<v8::String> script_source =
320 v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), source);
321 v8::ScriptData* preparse = v8::ScriptData::PreCompile(script_source);
322 v8::Local<v8::Script> script =
323 v8::Script::Compile(script_source, NULL, preparse);
324 v8::Local<v8::Value> result = script->Run();
325 delete preparse;
326 return result;
327 }
328
329
330 // Helper function that compiles and runs the source with given origin. 318 // Helper function that compiles and runs the source with given origin.
331 static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source, 319 static inline v8::Local<v8::Value> CompileRunWithOrigin(const char* source,
332 const char* origin_url, 320 const char* origin_url,
333 int line_number, 321 int line_number,
334 int column_number) { 322 int column_number) {
335 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 323 v8::Isolate* isolate = v8::Isolate::GetCurrent();
336 v8::ScriptOrigin origin(v8::String::NewFromUtf8(isolate, origin_url), 324 v8::ScriptOrigin origin(v8::String::NewFromUtf8(isolate, origin_url),
337 v8::Integer::New(isolate, line_number), 325 v8::Integer::New(isolate, line_number),
338 v8::Integer::New(isolate, column_number)); 326 v8::Integer::New(isolate, column_number));
339 return v8::Script::Compile(v8::String::NewFromUtf8(isolate, source), &origin) 327 return v8::Script::Compile(v8::String::NewFromUtf8(isolate, source), &origin)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects()); 371 CHECK_EQ(0, heap_profiler_->heap_object_map()->FindUntrackedObjects());
384 heap_profiler_->StopHeapObjectsTracking(); 372 heap_profiler_->StopHeapObjectsTracking();
385 } 373 }
386 374
387 private: 375 private:
388 i::HeapProfiler* heap_profiler_; 376 i::HeapProfiler* heap_profiler_;
389 }; 377 };
390 378
391 379
392 #endif // ifndef CCTEST_H_ 380 #endif // ifndef CCTEST_H_
OLDNEW
« no previous file with comments | « test/benchmarks/benchmarks.status ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698