| OLD | NEW |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 virtual void* Allocate(size_t length) { | 70 virtual void* Allocate(size_t length) { |
| 71 void* data = AllocateUninitialized(length); | 71 void* data = AllocateUninitialized(length); |
| 72 return data == NULL ? data : memset(data, 0, length); | 72 return data == NULL ? data : memset(data, 0, length); |
| 73 } | 73 } |
| 74 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } | 74 virtual void* AllocateUninitialized(size_t length) { return malloc(length); } |
| 75 virtual void Free(void* data, size_t) { free(data); } | 75 virtual void Free(void* data, size_t) { free(data); } |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 | 78 |
| 79 int main(int argc, char* argv[]) { | 79 int main(int argc, char* argv[]) { |
| 80 v8::V8::PerformPerThreadSetup(); |
| 80 v8::V8::InitializeICU(); | 81 v8::V8::InitializeICU(); |
| 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::V8::SetArrayBufferAllocator(&array_buffer_allocator); | 84 v8::V8::SetArrayBufferAllocator(&array_buffer_allocator); |
| 84 v8::Isolate* isolate = v8::Isolate::New(); | 85 v8::Isolate* isolate = v8::Isolate::New(); |
| 85 run_shell = (argc == 1); | 86 run_shell = (argc == 1); |
| 86 int result; | 87 int result; |
| 87 { | 88 { |
| 88 v8::Isolate::Scope isolate_scope(isolate); | 89 v8::Isolate::Scope isolate_scope(isolate); |
| 89 v8::HandleScope handle_scope(isolate); | 90 v8::HandleScope handle_scope(isolate); |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 fprintf(stderr, "^"); | 377 fprintf(stderr, "^"); |
| 377 } | 378 } |
| 378 fprintf(stderr, "\n"); | 379 fprintf(stderr, "\n"); |
| 379 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); | 380 v8::String::Utf8Value stack_trace(try_catch->StackTrace()); |
| 380 if (stack_trace.length() > 0) { | 381 if (stack_trace.length() > 0) { |
| 381 const char* stack_trace_string = ToCString(stack_trace); | 382 const char* stack_trace_string = ToCString(stack_trace); |
| 382 fprintf(stderr, "%s\n", stack_trace_string); | 383 fprintf(stderr, "%s\n", stack_trace_string); |
| 383 } | 384 } |
| 384 } | 385 } |
| 385 } | 386 } |
| OLD | NEW |