OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 type != JS_OBJECT_TYPE || | 578 type != JS_OBJECT_TYPE || |
579 instance_size != JSObject::kHeaderSize) { | 579 instance_size != JSObject::kHeaderSize) { |
580 Handle<Map> initial_map = NewMap(type, instance_size); | 580 Handle<Map> initial_map = NewMap(type, instance_size); |
581 function->set_initial_map(*initial_map); | 581 function->set_initial_map(*initial_map); |
582 initial_map->set_constructor(*function); | 582 initial_map->set_constructor(*function); |
583 } | 583 } |
584 | 584 |
585 // Set function.prototype and give the prototype a constructor | 585 // Set function.prototype and give the prototype a constructor |
586 // property that refers to the function. | 586 // property that refers to the function. |
587 SetPrototypeProperty(function, prototype); | 587 SetPrototypeProperty(function, prototype); |
588 SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM); | 588 // Currently safe because it is only invoked from Genesis. |
| 589 SetLocalPropertyNoThrow( |
| 590 prototype, Factory::constructor_symbol(), function, DONT_ENUM); |
589 return function; | 591 return function; |
590 } | 592 } |
591 | 593 |
592 | 594 |
593 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, | 595 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, |
594 Handle<Code> code) { | 596 Handle<Code> code) { |
595 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); | 597 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); |
596 function->shared()->set_code(*code); | 598 function->shared()->set_code(*code); |
597 function->set_code(*code); | 599 function->set_code(*code); |
598 ASSERT(!function->has_initial_map()); | 600 ASSERT(!function->has_initial_map()); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1076 Execution::ConfigureInstance(instance, | 1078 Execution::ConfigureInstance(instance, |
1077 instance_template, | 1079 instance_template, |
1078 pending_exception); | 1080 pending_exception); |
1079 } else { | 1081 } else { |
1080 *pending_exception = false; | 1082 *pending_exception = false; |
1081 } | 1083 } |
1082 } | 1084 } |
1083 | 1085 |
1084 | 1086 |
1085 } } // namespace v8::internal | 1087 } } // namespace v8::internal |
OLD | NEW |