| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 7515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7526 heap->isolate()->context()->native_context()-> | 7526 heap->isolate()->context()->native_context()-> |
| 7527 initial_object_prototype(); | 7527 initial_object_prototype(); |
| 7528 } else { | 7528 } else { |
| 7529 map()->set_non_instance_prototype(false); | 7529 map()->set_non_instance_prototype(false); |
| 7530 } | 7530 } |
| 7531 | 7531 |
| 7532 return SetInstancePrototype(construct_prototype); | 7532 return SetInstancePrototype(construct_prototype); |
| 7533 } | 7533 } |
| 7534 | 7534 |
| 7535 | 7535 |
| 7536 Object* JSFunction::RemovePrototype() { | 7536 void JSFunction::RemovePrototype() { |
| 7537 Context* native_context = context()->native_context(); | 7537 Context* native_context = context()->native_context(); |
| 7538 Map* no_prototype_map = shared()->is_classic_mode() | 7538 Map* no_prototype_map = shared()->is_classic_mode() |
| 7539 ? native_context->function_without_prototype_map() | 7539 ? native_context->function_without_prototype_map() |
| 7540 : native_context->strict_mode_function_without_prototype_map(); | 7540 : native_context->strict_mode_function_without_prototype_map(); |
| 7541 | 7541 |
| 7542 if (map() == no_prototype_map) { | 7542 if (map() == no_prototype_map) return; |
| 7543 // Be idempotent. | |
| 7544 return this; | |
| 7545 } | |
| 7546 | 7543 |
| 7547 ASSERT(map() == (shared()->is_classic_mode() | 7544 ASSERT(map() == (shared()->is_classic_mode() |
| 7548 ? native_context->function_map() | 7545 ? native_context->function_map() |
| 7549 : native_context->strict_mode_function_map())); | 7546 : native_context->strict_mode_function_map())); |
| 7550 | 7547 |
| 7551 set_map(no_prototype_map); | 7548 set_map(no_prototype_map); |
| 7552 set_prototype_or_initial_map(no_prototype_map->GetHeap()->the_hole_value()); | 7549 set_prototype_or_initial_map(no_prototype_map->GetHeap()->the_hole_value()); |
| 7553 return this; | |
| 7554 } | 7550 } |
| 7555 | 7551 |
| 7556 | 7552 |
| 7557 Object* JSFunction::SetInstanceClassName(String* name) { | 7553 void JSFunction::SetInstanceClassName(String* name) { |
| 7558 shared()->set_instance_class_name(name); | 7554 shared()->set_instance_class_name(name); |
| 7559 return this; | |
| 7560 } | 7555 } |
| 7561 | 7556 |
| 7562 | 7557 |
| 7563 void JSFunction::PrintName(FILE* out) { | 7558 void JSFunction::PrintName(FILE* out) { |
| 7564 SmartArrayPointer<char> name = shared()->DebugName()->ToCString(); | 7559 SmartArrayPointer<char> name = shared()->DebugName()->ToCString(); |
| 7565 PrintF(out, "%s", *name); | 7560 PrintF(out, "%s", *name); |
| 7566 } | 7561 } |
| 7567 | 7562 |
| 7568 | 7563 |
| 7569 Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) { | 7564 Context* JSFunction::NativeContextFromLiterals(FixedArray* literals) { |
| (...skipping 5646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13216 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13211 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
| 13217 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13212 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
| 13218 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13213 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
| 13219 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13214 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
| 13220 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13215 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
| 13221 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13216 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
| 13222 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13217 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
| 13223 } | 13218 } |
| 13224 | 13219 |
| 13225 } } // namespace v8::internal | 13220 } } // namespace v8::internal |
| OLD | NEW |