| 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 2391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2402 TransferObject(obj, object); | 2402 TransferObject(obj, object); |
| 2403 return true; | 2403 return true; |
| 2404 } | 2404 } |
| 2405 | 2405 |
| 2406 | 2406 |
| 2407 void Genesis::TransferNamedProperties(Handle<JSObject> from, | 2407 void Genesis::TransferNamedProperties(Handle<JSObject> from, |
| 2408 Handle<JSObject> to) { | 2408 Handle<JSObject> to) { |
| 2409 if (from->HasFastProperties()) { | 2409 if (from->HasFastProperties()) { |
| 2410 Handle<DescriptorArray> descs = | 2410 Handle<DescriptorArray> descs = |
| 2411 Handle<DescriptorArray>(from->map()->instance_descriptors()); | 2411 Handle<DescriptorArray>(from->map()->instance_descriptors()); |
| 2412 for (int i = 0; i < descs->number_of_descriptors(); i++) { | 2412 for (int i = 0; i < from->map()->NumberOfOwnDescriptors(); i++) { |
| 2413 PropertyDetails details = descs->GetDetails(i); | 2413 PropertyDetails details = descs->GetDetails(i); |
| 2414 switch (details.type()) { | 2414 switch (details.type()) { |
| 2415 case FIELD: { | 2415 case FIELD: { |
| 2416 HandleScope inner(isolate()); | 2416 HandleScope inner(isolate()); |
| 2417 Handle<Name> key = Handle<Name>(descs->GetKey(i)); | 2417 Handle<Name> key = Handle<Name>(descs->GetKey(i)); |
| 2418 int index = descs->GetFieldIndex(i); | 2418 int index = descs->GetFieldIndex(i); |
| 2419 Handle<Object> value = Handle<Object>(from->FastPropertyAt(index), | 2419 Handle<Object> value = Handle<Object>(from->FastPropertyAt(index), |
| 2420 isolate()); | 2420 isolate()); |
| 2421 CHECK_NOT_EMPTY_HANDLE(isolate(), | 2421 CHECK_NOT_EMPTY_HANDLE(isolate(), |
| 2422 JSObject::SetLocalPropertyIgnoreAttributes( | 2422 JSObject::SetLocalPropertyIgnoreAttributes( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2436 case CALLBACKS: { | 2436 case CALLBACKS: { |
| 2437 LookupResult result(isolate()); | 2437 LookupResult result(isolate()); |
| 2438 to->LocalLookup(descs->GetKey(i), &result); | 2438 to->LocalLookup(descs->GetKey(i), &result); |
| 2439 // If the property is already there we skip it | 2439 // If the property is already there we skip it |
| 2440 if (result.IsFound()) continue; | 2440 if (result.IsFound()) continue; |
| 2441 HandleScope inner(isolate()); | 2441 HandleScope inner(isolate()); |
| 2442 ASSERT(!to->HasFastProperties()); | 2442 ASSERT(!to->HasFastProperties()); |
| 2443 // Add to dictionary. | 2443 // Add to dictionary. |
| 2444 Handle<Name> key = Handle<Name>(descs->GetKey(i)); | 2444 Handle<Name> key = Handle<Name>(descs->GetKey(i)); |
| 2445 Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate()); | 2445 Handle<Object> callbacks(descs->GetCallbacksObject(i), isolate()); |
| 2446 PropertyDetails d = PropertyDetails(details.attributes(), | 2446 PropertyDetails d = PropertyDetails( |
| 2447 CALLBACKS, | 2447 details.attributes(), CALLBACKS, i + 1); |
| 2448 Representation::Tagged(), | |
| 2449 details.descriptor_index()); | |
| 2450 JSObject::SetNormalizedProperty(to, key, callbacks, d); | 2448 JSObject::SetNormalizedProperty(to, key, callbacks, d); |
| 2451 break; | 2449 break; |
| 2452 } | 2450 } |
| 2453 case NORMAL: | 2451 case NORMAL: |
| 2454 // Do not occur since the from object has fast properties. | 2452 // Do not occur since the from object has fast properties. |
| 2455 case HANDLER: | 2453 case HANDLER: |
| 2456 case INTERCEPTOR: | 2454 case INTERCEPTOR: |
| 2457 case TRANSITION: | 2455 case TRANSITION: |
| 2458 case NONEXISTENT: | 2456 case NONEXISTENT: |
| 2459 // No element in instance descriptors have proxy or interceptor type. | 2457 // No element in instance descriptors have proxy or interceptor type. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2619 return from + sizeof(NestingCounterType); | 2617 return from + sizeof(NestingCounterType); |
| 2620 } | 2618 } |
| 2621 | 2619 |
| 2622 | 2620 |
| 2623 // Called when the top-level V8 mutex is destroyed. | 2621 // Called when the top-level V8 mutex is destroyed. |
| 2624 void Bootstrapper::FreeThreadResources() { | 2622 void Bootstrapper::FreeThreadResources() { |
| 2625 ASSERT(!IsActive()); | 2623 ASSERT(!IsActive()); |
| 2626 } | 2624 } |
| 2627 | 2625 |
| 2628 } } // namespace v8::internal | 2626 } } // namespace v8::internal |
| OLD | NEW |