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