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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
573 type != JS_OBJECT_TYPE || | 573 type != JS_OBJECT_TYPE || |
574 instance_size != JSObject::kHeaderSize) { | 574 instance_size != JSObject::kHeaderSize) { |
575 Handle<Map> initial_map = NewMap(type, instance_size); | 575 Handle<Map> initial_map = NewMap(type, instance_size); |
576 function->set_initial_map(*initial_map); | 576 function->set_initial_map(*initial_map); |
577 initial_map->set_constructor(*function); | 577 initial_map->set_constructor(*function); |
578 } | 578 } |
579 | 579 |
580 // Set function.prototype and give the prototype a constructor | 580 // Set function.prototype and give the prototype a constructor |
581 // property that refers to the function. | 581 // property that refers to the function. |
582 SetPrototypeProperty(function, prototype); | 582 SetPrototypeProperty(function, prototype); |
583 SetProperty(prototype, Factory::constructor_symbol(), function, DONT_ENUM); | 583 // Currently save as is only invoked from Genesis. |
Mads Ager (chromium)
2011/02/10 10:26:43
save as -> safe because it
antonm
2011/02/10 14:18:33
Done.
| |
584 SetLocalPropertyNoThrow( | |
585 prototype, Factory::constructor_symbol(), function, DONT_ENUM); | |
584 return function; | 586 return function; |
585 } | 587 } |
586 | 588 |
587 | 589 |
588 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, | 590 Handle<JSFunction> Factory::NewFunctionWithoutPrototype(Handle<String> name, |
589 Handle<Code> code) { | 591 Handle<Code> code) { |
590 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); | 592 Handle<JSFunction> function = NewFunctionWithoutPrototype(name); |
591 function->shared()->set_code(*code); | 593 function->shared()->set_code(*code); |
592 function->set_code(*code); | 594 function->set_code(*code); |
593 ASSERT(!function->has_initial_map()); | 595 ASSERT(!function->has_initial_map()); |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1071 Execution::ConfigureInstance(instance, | 1073 Execution::ConfigureInstance(instance, |
1072 instance_template, | 1074 instance_template, |
1073 pending_exception); | 1075 pending_exception); |
1074 } else { | 1076 } else { |
1075 *pending_exception = false; | 1077 *pending_exception = false; |
1076 } | 1078 } |
1077 } | 1079 } |
1078 | 1080 |
1079 | 1081 |
1080 } } // namespace v8::internal | 1082 } } // namespace v8::internal |
OLD | NEW |