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 7544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7555 if (code->kind() != Code::FUNCTION) return true; | 7555 if (code->kind() != Code::FUNCTION) return true; |
7556 return code->optimizable(); | 7556 return code->optimizable(); |
7557 } | 7557 } |
7558 | 7558 |
7559 | 7559 |
7560 MaybeObject* JSObject::OptimizeAsPrototype() { | 7560 MaybeObject* JSObject::OptimizeAsPrototype() { |
7561 if (IsGlobalObject()) return this; | 7561 if (IsGlobalObject()) return this; |
7562 | 7562 |
7563 // Make sure prototypes are fast objects and their maps have the bit set | 7563 // Make sure prototypes are fast objects and their maps have the bit set |
7564 // so they remain fast. | 7564 // so they remain fast. |
7565 Map* proto_map = map(); | |
7566 if (!HasFastProperties()) { | 7565 if (!HasFastProperties()) { |
7567 MaybeObject* new_proto = TransformToFastProperties(0); | 7566 MaybeObject* new_proto = TransformToFastProperties(0); |
7568 if (new_proto->IsFailure()) return new_proto; | 7567 if (new_proto->IsFailure()) return new_proto; |
7569 ASSERT(new_proto == this); | 7568 ASSERT(new_proto == this); |
7570 proto_map = map(); | |
7571 } | 7569 } |
7572 return this; | 7570 return this; |
7573 } | 7571 } |
7574 | 7572 |
7575 | 7573 |
7576 MaybeObject* JSFunction::SetInstancePrototype(Object* value) { | 7574 MaybeObject* JSFunction::SetInstancePrototype(Object* value) { |
7577 ASSERT(value->IsJSReceiver()); | 7575 ASSERT(value->IsJSReceiver()); |
7578 Heap* heap = GetHeap(); | 7576 Heap* heap = GetHeap(); |
7579 | 7577 |
7580 // First some logic for the map of the prototype to make sure it is in fast | 7578 // First some logic for the map of the prototype to make sure it is in fast |
(...skipping 5669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13250 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); | 13248 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); |
13251 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); | 13249 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); |
13252 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); | 13250 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); |
13253 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); | 13251 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); |
13254 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); | 13252 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); |
13255 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); | 13253 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); |
13256 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); | 13254 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); |
13257 } | 13255 } |
13258 | 13256 |
13259 } } // namespace v8::internal | 13257 } } // namespace v8::internal |
OLD | NEW |