| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 MapCounters(i::FLAG_map_counters); | 335 MapCounters(i::FLAG_map_counters); |
| 336 if (i::FLAG_dump_counters) | 336 if (i::FLAG_dump_counters) |
| 337 V8::SetCounterFunction(LookupCounter); | 337 V8::SetCounterFunction(LookupCounter); |
| 338 // Initialize the global objects | 338 // Initialize the global objects |
| 339 HandleScope scope; | 339 HandleScope scope; |
| 340 Handle<ObjectTemplate> global_template = ObjectTemplate::New(); | 340 Handle<ObjectTemplate> global_template = ObjectTemplate::New(); |
| 341 global_template->Set(String::New("print"), FunctionTemplate::New(Print)); | 341 global_template->Set(String::New("print"), FunctionTemplate::New(Print)); |
| 342 global_template->Set(String::New("load"), FunctionTemplate::New(Load)); | 342 global_template->Set(String::New("load"), FunctionTemplate::New(Load)); |
| 343 global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); | 343 global_template->Set(String::New("quit"), FunctionTemplate::New(Quit)); |
| 344 global_template->Set(String::New("version"), FunctionTemplate::New(Version)); | 344 global_template->Set(String::New("version"), FunctionTemplate::New(Version)); |
| 345 global_template->Set(String::New("system"), FunctionTemplate::New(System)); |
| 345 | 346 |
| 346 utility_context_ = Context::New(NULL, global_template); | 347 utility_context_ = Context::New(NULL, global_template); |
| 347 utility_context_->SetSecurityToken(Undefined()); | 348 utility_context_->SetSecurityToken(Undefined()); |
| 348 Context::Scope utility_scope(utility_context_); | 349 Context::Scope utility_scope(utility_context_); |
| 349 | 350 |
| 350 i::JSArguments js_args = i::FLAG_js_arguments; | 351 i::JSArguments js_args = i::FLAG_js_arguments; |
| 351 i::Handle<i::FixedArray> arguments_array = | 352 i::Handle<i::FixedArray> arguments_array = |
| 352 i::Factory::NewFixedArray(js_args.argc()); | 353 i::Factory::NewFixedArray(js_args.argc()); |
| 353 for (int j = 0; j < js_args.argc(); j++) { | 354 for (int j = 0; j < js_args.argc(); j++) { |
| 354 i::Handle<i::String> arg = | 355 i::Handle<i::String> arg = |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 return 0; | 665 return 0; |
| 665 } | 666 } |
| 666 | 667 |
| 667 | 668 |
| 668 } // namespace v8 | 669 } // namespace v8 |
| 669 | 670 |
| 670 | 671 |
| 671 int main(int argc, char* argv[]) { | 672 int main(int argc, char* argv[]) { |
| 672 return v8::Shell::Main(argc, argv); | 673 return v8::Shell::Main(argc, argv); |
| 673 } | 674 } |
| OLD | NEW |