| 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 3043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3054 | 3054 |
| 3055 // Create a new map featuring the new field descriptors array. | 3055 // Create a new map featuring the new field descriptors array. |
| 3056 Handle<Map> map = handle(function->map()); | 3056 Handle<Map> map = handle(function->map()); |
| 3057 Handle<Map> new_map = Map::CopyReplaceDescriptor( | 3057 Handle<Map> new_map = Map::CopyReplaceDescriptor( |
| 3058 map, instance_desc, &new_desc, index, OMIT_TRANSITION); | 3058 map, instance_desc, &new_desc, index, OMIT_TRANSITION); |
| 3059 | 3059 |
| 3060 JSObject::MigrateToMap(function, new_map); | 3060 JSObject::MigrateToMap(function, new_map); |
| 3061 } else { // Dictionary properties. | 3061 } else { // Dictionary properties. |
| 3062 // Directly manipulate the property details. | 3062 // Directly manipulate the property details. |
| 3063 DisallowHeapAllocation no_gc; | 3063 DisallowHeapAllocation no_gc; |
| 3064 int entry = function->property_dictionary()->FindEntry(*name); | 3064 int entry = function->property_dictionary()->FindEntry(name); |
| 3065 ASSERT(entry != NameDictionary::kNotFound); | 3065 ASSERT(entry != NameDictionary::kNotFound); |
| 3066 PropertyDetails details = function->property_dictionary()->DetailsAt(entry); | 3066 PropertyDetails details = function->property_dictionary()->DetailsAt(entry); |
| 3067 PropertyDetails new_details( | 3067 PropertyDetails new_details( |
| 3068 static_cast<PropertyAttributes>(details.attributes() | READ_ONLY), | 3068 static_cast<PropertyAttributes>(details.attributes() | READ_ONLY), |
| 3069 details.type(), | 3069 details.type(), |
| 3070 details.dictionary_index()); | 3070 details.dictionary_index()); |
| 3071 function->property_dictionary()->DetailsAtPut(entry, new_details); | 3071 function->property_dictionary()->DetailsAtPut(entry, new_details); |
| 3072 } | 3072 } |
| 3073 return *function; | 3073 return *function; |
| 3074 } | 3074 } |
| (...skipping 12034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15109 Handle<Smi>(Smi::FromInt(i), isolate), | 15109 Handle<Smi>(Smi::FromInt(i), isolate), |
| 15110 PropertyDetails(NONE, NORMAL, Representation::None())); | 15110 PropertyDetails(NONE, NORMAL, Representation::None())); |
| 15111 // The dictionary does not need to grow. | 15111 // The dictionary does not need to grow. |
| 15112 CHECK(new_dict.is_identical_to(dict)); | 15112 CHECK(new_dict.is_identical_to(dict)); |
| 15113 } | 15113 } |
| 15114 } | 15114 } |
| 15115 | 15115 |
| 15116 | 15116 |
| 15117 const Runtime::Function* Runtime::FunctionForName(Handle<String> name) { | 15117 const Runtime::Function* Runtime::FunctionForName(Handle<String> name) { |
| 15118 Heap* heap = name->GetHeap(); | 15118 Heap* heap = name->GetHeap(); |
| 15119 int entry = heap->intrinsic_function_names()->FindEntry(*name); | 15119 int entry = heap->intrinsic_function_names()->FindEntry(name); |
| 15120 if (entry != kNotFound) { | 15120 if (entry != kNotFound) { |
| 15121 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry); | 15121 Object* smi_index = heap->intrinsic_function_names()->ValueAt(entry); |
| 15122 int function_index = Smi::cast(smi_index)->value(); | 15122 int function_index = Smi::cast(smi_index)->value(); |
| 15123 return &(kIntrinsicFunctions[function_index]); | 15123 return &(kIntrinsicFunctions[function_index]); |
| 15124 } | 15124 } |
| 15125 return NULL; | 15125 return NULL; |
| 15126 } | 15126 } |
| 15127 | 15127 |
| 15128 | 15128 |
| 15129 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15129 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15130 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15130 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15131 } | 15131 } |
| 15132 | 15132 |
| 15133 } } // namespace v8::internal | 15133 } } // namespace v8::internal |
| OLD | NEW |