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

Side by Side Diff: samples/shell.cc

Issue 1314863002: Version 4.5.103.27 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.5
Patch Set: Created 5 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
« 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void* data = AllocateUninitialized(length); 68 void* data = AllocateUninitialized(length);
69 return data == NULL ? data : memset(data, 0, length); 69 return data == NULL ? data : memset(data, 0, length);
70 } 70 }
71 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } 71 virtual void* AllocateUninitialized(size_t length) { return malloc(length); }
72 virtual void Free(void* data, size_t) { free(data); } 72 virtual void Free(void* data, size_t) { free(data); }
73 }; 73 };
74 74
75 75
76 int main(int argc, char* argv[]) { 76 int main(int argc, char* argv[]) {
77 v8::V8::InitializeICU(); 77 v8::V8::InitializeICU();
78 v8::V8::InitializeExternalStartupData(argv[0]);
78 v8::Platform* platform = v8::platform::CreateDefaultPlatform(); 79 v8::Platform* platform = v8::platform::CreateDefaultPlatform();
79 v8::V8::InitializePlatform(platform); 80 v8::V8::InitializePlatform(platform);
80 v8::V8::Initialize(); 81 v8::V8::Initialize();
81 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); 82 v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
82 ShellArrayBufferAllocator array_buffer_allocator; 83 ShellArrayBufferAllocator array_buffer_allocator;
83 v8::Isolate::CreateParams create_params; 84 v8::Isolate::CreateParams create_params;
84 create_params.array_buffer_allocator = &array_buffer_allocator; 85 create_params.array_buffer_allocator = &array_buffer_allocator;
85 v8::Isolate* isolate = v8::Isolate::New(create_params); 86 v8::Isolate* isolate = v8::Isolate::New(create_params);
86 run_shell = (argc == 1); 87 run_shell = (argc == 1);
87 int result; 88 int result;
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 } 405 }
405 fprintf(stderr, "\n"); 406 fprintf(stderr, "\n");
406 v8::String::Utf8Value stack_trace( 407 v8::String::Utf8Value stack_trace(
407 try_catch->StackTrace(context).ToLocalChecked()); 408 try_catch->StackTrace(context).ToLocalChecked());
408 if (stack_trace.length() > 0) { 409 if (stack_trace.length() > 0) {
409 const char* stack_trace_string = ToCString(stack_trace); 410 const char* stack_trace_string = ToCString(stack_trace);
410 fprintf(stderr, "%s\n", stack_trace_string); 411 fprintf(stderr, "%s\n", stack_trace_string);
411 } 412 }
412 } 413 }
413 } 414 }
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