OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 global_context()->set_initial_object_prototype(*prototype); | 476 global_context()->set_initial_object_prototype(*prototype); |
477 SetPrototype(object_fun, prototype); | 477 SetPrototype(object_fun, prototype); |
478 object_function_map-> | 478 object_function_map-> |
479 set_instance_descriptors(heap->empty_descriptor_array()); | 479 set_instance_descriptors(heap->empty_descriptor_array()); |
480 } | 480 } |
481 | 481 |
482 // Allocate the empty function as the prototype for function ECMAScript | 482 // Allocate the empty function as the prototype for function ECMAScript |
483 // 262 15.3.4. | 483 // 262 15.3.4. |
484 Handle<String> symbol = factory->LookupAsciiSymbol("Empty"); | 484 Handle<String> symbol = factory->LookupAsciiSymbol("Empty"); |
485 Handle<JSFunction> empty_function = | 485 Handle<JSFunction> empty_function = |
486 factory->NewFunctionWithoutPrototype(symbol, kNonStrictMode); | 486 factory->NewFunctionWithoutPrototype(symbol, CLASSIC_MODE); |
487 | 487 |
488 // --- E m p t y --- | 488 // --- E m p t y --- |
489 Handle<Code> code = | 489 Handle<Code> code = |
490 Handle<Code>(isolate->builtins()->builtin( | 490 Handle<Code>(isolate->builtins()->builtin( |
491 Builtins::kEmptyFunction)); | 491 Builtins::kEmptyFunction)); |
492 empty_function->set_code(*code); | 492 empty_function->set_code(*code); |
493 empty_function->shared()->set_code(*code); | 493 empty_function->shared()->set_code(*code); |
494 Handle<String> source = factory->NewStringFromAscii(CStrVector("() {}")); | 494 Handle<String> source = factory->NewStringFromAscii(CStrVector("() {}")); |
495 Handle<Script> script = factory->NewScript(source); | 495 Handle<Script> script = factory->NewScript(source); |
496 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); | 496 script->set_type(Smi::FromInt(Script::TYPE_NATIVE)); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 descriptors->Sort(witness); | 565 descriptors->Sort(witness); |
566 return descriptors; | 566 return descriptors; |
567 } | 567 } |
568 | 568 |
569 | 569 |
570 // ECMAScript 5th Edition, 13.2.3 | 570 // ECMAScript 5th Edition, 13.2.3 |
571 Handle<JSFunction> Genesis::GetThrowTypeErrorFunction() { | 571 Handle<JSFunction> Genesis::GetThrowTypeErrorFunction() { |
572 if (throw_type_error_function.is_null()) { | 572 if (throw_type_error_function.is_null()) { |
573 Handle<String> name = factory()->LookupAsciiSymbol("ThrowTypeError"); | 573 Handle<String> name = factory()->LookupAsciiSymbol("ThrowTypeError"); |
574 throw_type_error_function = | 574 throw_type_error_function = |
575 factory()->NewFunctionWithoutPrototype(name, kNonStrictMode); | 575 factory()->NewFunctionWithoutPrototype(name, CLASSIC_MODE); |
576 Handle<Code> code(isolate()->builtins()->builtin( | 576 Handle<Code> code(isolate()->builtins()->builtin( |
577 Builtins::kStrictModePoisonPill)); | 577 Builtins::kStrictModePoisonPill)); |
578 throw_type_error_function->set_map( | 578 throw_type_error_function->set_map( |
579 global_context()->function_map()); | 579 global_context()->function_map()); |
580 throw_type_error_function->set_code(*code); | 580 throw_type_error_function->set_code(*code); |
581 throw_type_error_function->shared()->set_code(*code); | 581 throw_type_error_function->shared()->set_code(*code); |
582 throw_type_error_function->shared()->DontAdaptArguments(); | 582 throw_type_error_function->shared()->DontAdaptArguments(); |
583 | 583 |
584 PreventExtensions(throw_type_error_function); | 584 PreventExtensions(throw_type_error_function); |
585 } | 585 } |
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2306 return from + sizeof(NestingCounterType); | 2306 return from + sizeof(NestingCounterType); |
2307 } | 2307 } |
2308 | 2308 |
2309 | 2309 |
2310 // Called when the top-level V8 mutex is destroyed. | 2310 // Called when the top-level V8 mutex is destroyed. |
2311 void Bootstrapper::FreeThreadResources() { | 2311 void Bootstrapper::FreeThreadResources() { |
2312 ASSERT(!IsActive()); | 2312 ASSERT(!IsActive()); |
2313 } | 2313 } |
2314 | 2314 |
2315 } } // namespace v8::internal | 2315 } } // namespace v8::internal |
OLD | NEW |