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

Side by Side Diff: tools/lexer-shell.cc

Issue 124943004: Prepare removal of ObjectTemplate::New without Isolate parameter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Do not remove ObjectTemplate::New() yet. Created 6 years, 11 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/cctest/test-thread-termination.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 } else if (strncmp(argv[i], "--repeat=", 9) == 0) { 238 } else if (strncmp(argv[i], "--repeat=", 9) == 0) {
239 std::string repeat_str = std::string(argv[i]).substr(9); 239 std::string repeat_str = std::string(argv[i]).substr(9);
240 repeat = atoi(repeat_str.c_str()); 240 repeat = atoi(repeat_str.c_str());
241 } else if (i > 0 && argv[i][0] != '-') { 241 } else if (i > 0 && argv[i][0] != '-') {
242 fnames.push_back(std::string(argv[i])); 242 fnames.push_back(std::string(argv[i]));
243 } 243 }
244 } 244 }
245 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 245 v8::Isolate* isolate = v8::Isolate::GetCurrent();
246 { 246 {
247 v8::HandleScope handle_scope(isolate); 247 v8::HandleScope handle_scope(isolate);
248 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); 248 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
249 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global); 249 v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
250 ASSERT(!context.IsEmpty()); 250 ASSERT(!context.IsEmpty());
251 { 251 {
252 v8::Context::Scope scope(context); 252 v8::Context::Scope scope(context);
253 Isolate* isolate = Isolate::Current(); 253 Isolate* isolate = Isolate::Current();
254 double baseline_total = 0; 254 double baseline_total = 0;
255 for (size_t i = 0; i < fnames.size(); i++) { 255 for (size_t i = 0; i < fnames.size(); i++) {
256 TimeDelta time; 256 TimeDelta time;
257 time = ProcessFile(fnames[i].c_str(), encoding, isolate, print_tokens, 257 time = ProcessFile(fnames[i].c_str(), encoding, isolate, print_tokens,
258 repeat); 258 repeat);
259 baseline_total += time.InMillisecondsF(); 259 baseline_total += time.InMillisecondsF();
260 } 260 }
261 if (benchmark.empty()) benchmark = "Baseline"; 261 if (benchmark.empty()) benchmark = "Baseline";
262 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), baseline_total); 262 printf("%s(RunTime): %.f ms\n", benchmark.c_str(), baseline_total);
263 } 263 }
264 } 264 }
265 v8::V8::Dispose(); 265 v8::V8::Dispose();
266 return 0; 266 return 0;
267 } 267 }
OLDNEW
« no previous file with comments | « test/cctest/test-thread-termination.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698