| 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 2157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2168 Handle<JSFunction>(descs->GetConstantFunction(i)); | 2168 Handle<JSFunction>(descs->GetConstantFunction(i)); |
| 2169 CHECK_NOT_EMPTY_HANDLE(to->GetIsolate(), | 2169 CHECK_NOT_EMPTY_HANDLE(to->GetIsolate(), |
| 2170 JSObject::SetLocalPropertyIgnoreAttributes( | 2170 JSObject::SetLocalPropertyIgnoreAttributes( |
| 2171 to, key, fun, details.attributes())); | 2171 to, key, fun, details.attributes())); |
| 2172 break; | 2172 break; |
| 2173 } | 2173 } |
| 2174 case CALLBACKS: { | 2174 case CALLBACKS: { |
| 2175 LookupResult result(isolate()); | 2175 LookupResult result(isolate()); |
| 2176 to->LocalLookup(descs->GetKey(i), &result); | 2176 to->LocalLookup(descs->GetKey(i), &result); |
| 2177 // If the property is already there we skip it | 2177 // If the property is already there we skip it |
| 2178 if (result.IsProperty()) continue; | 2178 if (result.IsFound()) continue; |
| 2179 HandleScope inner; | 2179 HandleScope inner; |
| 2180 ASSERT(!to->HasFastProperties()); | 2180 ASSERT(!to->HasFastProperties()); |
| 2181 // Add to dictionary. | 2181 // Add to dictionary. |
| 2182 Handle<String> key = Handle<String>(descs->GetKey(i)); | 2182 Handle<String> key = Handle<String>(descs->GetKey(i)); |
| 2183 Handle<Object> callbacks(descs->GetCallbacksObject(i)); | 2183 Handle<Object> callbacks(descs->GetCallbacksObject(i)); |
| 2184 PropertyDetails d = | 2184 PropertyDetails d = |
| 2185 PropertyDetails(details.attributes(), CALLBACKS, details.index()); | 2185 PropertyDetails(details.attributes(), CALLBACKS, details.index()); |
| 2186 JSObject::SetNormalizedProperty(to, key, callbacks, d); | 2186 JSObject::SetNormalizedProperty(to, key, callbacks, d); |
| 2187 break; | 2187 break; |
| 2188 } | 2188 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2201 Handle<StringDictionary> properties = | 2201 Handle<StringDictionary> properties = |
| 2202 Handle<StringDictionary>(from->property_dictionary()); | 2202 Handle<StringDictionary>(from->property_dictionary()); |
| 2203 int capacity = properties->Capacity(); | 2203 int capacity = properties->Capacity(); |
| 2204 for (int i = 0; i < capacity; i++) { | 2204 for (int i = 0; i < capacity; i++) { |
| 2205 Object* raw_key(properties->KeyAt(i)); | 2205 Object* raw_key(properties->KeyAt(i)); |
| 2206 if (properties->IsKey(raw_key)) { | 2206 if (properties->IsKey(raw_key)) { |
| 2207 ASSERT(raw_key->IsString()); | 2207 ASSERT(raw_key->IsString()); |
| 2208 // If the property is already there we skip it. | 2208 // If the property is already there we skip it. |
| 2209 LookupResult result(isolate()); | 2209 LookupResult result(isolate()); |
| 2210 to->LocalLookup(String::cast(raw_key), &result); | 2210 to->LocalLookup(String::cast(raw_key), &result); |
| 2211 if (result.IsProperty()) continue; | 2211 if (result.IsFound()) continue; |
| 2212 // Set the property. | 2212 // Set the property. |
| 2213 Handle<String> key = Handle<String>(String::cast(raw_key)); | 2213 Handle<String> key = Handle<String>(String::cast(raw_key)); |
| 2214 Handle<Object> value = Handle<Object>(properties->ValueAt(i)); | 2214 Handle<Object> value = Handle<Object>(properties->ValueAt(i)); |
| 2215 if (value->IsJSGlobalPropertyCell()) { | 2215 if (value->IsJSGlobalPropertyCell()) { |
| 2216 value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value()); | 2216 value = Handle<Object>(JSGlobalPropertyCell::cast(*value)->value()); |
| 2217 } | 2217 } |
| 2218 PropertyDetails details = properties->DetailsAt(i); | 2218 PropertyDetails details = properties->DetailsAt(i); |
| 2219 CHECK_NOT_EMPTY_HANDLE(to->GetIsolate(), | 2219 CHECK_NOT_EMPTY_HANDLE(to->GetIsolate(), |
| 2220 JSObject::SetLocalPropertyIgnoreAttributes( | 2220 JSObject::SetLocalPropertyIgnoreAttributes( |
| 2221 to, key, value, details.attributes())); | 2221 to, key, value, details.attributes())); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 return from + sizeof(NestingCounterType); | 2354 return from + sizeof(NestingCounterType); |
| 2355 } | 2355 } |
| 2356 | 2356 |
| 2357 | 2357 |
| 2358 // Called when the top-level V8 mutex is destroyed. | 2358 // Called when the top-level V8 mutex is destroyed. |
| 2359 void Bootstrapper::FreeThreadResources() { | 2359 void Bootstrapper::FreeThreadResources() { |
| 2360 ASSERT(!IsActive()); | 2360 ASSERT(!IsActive()); |
| 2361 } | 2361 } |
| 2362 | 2362 |
| 2363 } } // namespace v8::internal | 2363 } } // namespace v8::internal |
| OLD | NEW |