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 5518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5529 Top::context()->global_context()->initial_object_prototype(); | 5529 Top::context()->global_context()->initial_object_prototype(); |
5530 } else { | 5530 } else { |
5531 map()->set_non_instance_prototype(false); | 5531 map()->set_non_instance_prototype(false); |
5532 } | 5532 } |
5533 | 5533 |
5534 return SetInstancePrototype(construct_prototype); | 5534 return SetInstancePrototype(construct_prototype); |
5535 } | 5535 } |
5536 | 5536 |
5537 | 5537 |
5538 Object* JSFunction::RemovePrototype() { | 5538 Object* JSFunction::RemovePrototype() { |
5539 Map* no_prototype_map = shared()->strict_mode() | 5539 if (map() == context()->global_context()->function_without_prototype_map()) { |
5540 ? context()->global_context()->function_without_prototype_map_strict() | |
5541 : context()->global_context()->function_without_prototype_map(); | |
5542 | |
5543 if (map() == no_prototype_map) { | |
5544 // Be idempotent. | 5540 // Be idempotent. |
5545 return this; | 5541 return this; |
5546 } | 5542 } |
5547 | 5543 ASSERT(map() == context()->global_context()->function_map()); |
5548 ASSERT(!shared()->strict_mode() || | 5544 set_map(context()->global_context()->function_without_prototype_map()); |
5549 map() == context()->global_context()->function_map_strict()); | |
5550 ASSERT(shared()->strict_mode() || | |
5551 map() == context()->global_context()->function_map()); | |
5552 | |
5553 set_map(no_prototype_map); | |
5554 set_prototype_or_initial_map(Heap::the_hole_value()); | 5545 set_prototype_or_initial_map(Heap::the_hole_value()); |
5555 return this; | 5546 return this; |
5556 } | 5547 } |
5557 | 5548 |
5558 | 5549 |
5559 Object* JSFunction::SetInstanceClassName(String* name) { | 5550 Object* JSFunction::SetInstanceClassName(String* name) { |
5560 shared()->set_instance_class_name(name); | 5551 shared()->set_instance_class_name(name); |
5561 return this; | 5552 return this; |
5562 } | 5553 } |
5563 | 5554 |
(...skipping 4487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10051 if (break_point_objects()->IsUndefined()) return 0; | 10042 if (break_point_objects()->IsUndefined()) return 0; |
10052 // Single beak point. | 10043 // Single beak point. |
10053 if (!break_point_objects()->IsFixedArray()) return 1; | 10044 if (!break_point_objects()->IsFixedArray()) return 1; |
10054 // Multiple break points. | 10045 // Multiple break points. |
10055 return FixedArray::cast(break_point_objects())->length(); | 10046 return FixedArray::cast(break_point_objects())->length(); |
10056 } | 10047 } |
10057 #endif | 10048 #endif |
10058 | 10049 |
10059 | 10050 |
10060 } } // namespace v8::internal | 10051 } } // namespace v8::internal |
OLD | NEW |