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

Side by Side Diff: samples/shell.cc

Issue 582953002: Revert "Require V8 to be explicitly initialized before an Isolate is created" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | « samples/process.cc ('k') | src/api.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } 77 virtual void* AllocateUninitialized(size_t length) { return malloc(length); }
78 virtual void Free(void* data, size_t) { free(data); } 78 virtual void Free(void* data, size_t) { free(data); }
79 }; 79 };
80 80
81 81
82 int main(int argc, char* argv[]) { 82 int main(int argc, char* argv[]) {
83 v8::V8::InitializeICU(); 83 v8::V8::InitializeICU();
84 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); 84 v8::Platform* platform = v8::platform::CreateDefaultPlatform();
85 v8::V8::InitializePlatform(platform); 85 v8::V8::InitializePlatform(platform);
86 v8::V8::Initialize();
87 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); 86 v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
88 ShellArrayBufferAllocator array_buffer_allocator; 87 ShellArrayBufferAllocator array_buffer_allocator;
89 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); 88 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator);
90 v8::Isolate* isolate = v8::Isolate::New(); 89 v8::Isolate* isolate = v8::Isolate::New();
91 run_shell = (argc == 1); 90 run_shell = (argc == 1);
92 int result; 91 int result;
93 { 92 {
94 v8::Isolate::Scope isolate_scope(isolate); 93 v8::Isolate::Scope isolate_scope(isolate);
95 v8::HandleScope handle_scope(isolate); 94 v8::HandleScope handle_scope(isolate);
96 v8::Handle<v8::Context> context = CreateShellContext(isolate); 95 v8::Handle<v8::Context> context = CreateShellContext(isolate);
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 fprintf(stderr, "^"); 383 fprintf(stderr, "^");
385 } 384 }
386 fprintf(stderr, "\n"); 385 fprintf(stderr, "\n");
387 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); 386 v8::String::Utf8Value stack_trace(try_catch->StackTrace());
388 if (stack_trace.length() > 0) { 387 if (stack_trace.length() > 0) {
389 const char* stack_trace_string = ToCString(stack_trace); 388 const char* stack_trace_string = ToCString(stack_trace);
390 fprintf(stderr, "%s\n", stack_trace_string); 389 fprintf(stderr, "%s\n", stack_trace_string);
391 } 390 }
392 } 391 }
393 } 392 }
OLDNEW
« no previous file with comments | « samples/process.cc ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698