| 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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1088 function->shared()->set_expected_nof_properties(2); | 1088 function->shared()->set_expected_nof_properties(2); |
| 1089 Handle<JSObject> result = factory->NewJSObject(function); | 1089 Handle<JSObject> result = factory->NewJSObject(function); |
| 1090 | 1090 |
| 1091 native_context()->set_arguments_boilerplate(*result); | 1091 native_context()->set_arguments_boilerplate(*result); |
| 1092 // Note: length must be added as the first property and | 1092 // Note: length must be added as the first property and |
| 1093 // callee must be added as the second property. | 1093 // callee must be added as the second property. |
| 1094 CHECK_NOT_EMPTY_HANDLE(isolate, | 1094 CHECK_NOT_EMPTY_HANDLE(isolate, |
| 1095 JSObject::SetLocalPropertyIgnoreAttributes( | 1095 JSObject::SetLocalPropertyIgnoreAttributes( |
| 1096 result, factory->length_string(), | 1096 result, factory->length_string(), |
| 1097 factory->undefined_value(), DONT_ENUM, | 1097 factory->undefined_value(), DONT_ENUM, |
| 1098 Object::FORCE_TAGGED)); | 1098 Object::FORCE_TAGGED, JSReceiver::FORCE_FIELD)); |
| 1099 CHECK_NOT_EMPTY_HANDLE(isolate, | 1099 CHECK_NOT_EMPTY_HANDLE(isolate, |
| 1100 JSObject::SetLocalPropertyIgnoreAttributes( | 1100 JSObject::SetLocalPropertyIgnoreAttributes( |
| 1101 result, factory->callee_string(), | 1101 result, factory->callee_string(), |
| 1102 factory->undefined_value(), DONT_ENUM, | 1102 factory->undefined_value(), DONT_ENUM, |
| 1103 Object::FORCE_TAGGED)); | 1103 Object::FORCE_TAGGED, JSReceiver::FORCE_FIELD)); |
| 1104 | 1104 |
| 1105 #ifdef DEBUG | 1105 #ifdef DEBUG |
| 1106 LookupResult lookup(isolate); | 1106 LookupResult lookup(isolate); |
| 1107 result->LocalLookup(heap->callee_string(), &lookup); | 1107 result->LocalLookup(heap->callee_string(), &lookup); |
| 1108 ASSERT(lookup.IsField()); | 1108 ASSERT(lookup.IsField()); |
| 1109 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsCalleeIndex); | 1109 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsCalleeIndex); |
| 1110 | 1110 |
| 1111 result->LocalLookup(heap->length_string(), &lookup); | 1111 result->LocalLookup(heap->length_string(), &lookup); |
| 1112 ASSERT(lookup.IsField()); | 1112 ASSERT(lookup.IsField()); |
| 1113 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex); | 1113 ASSERT(lookup.GetFieldIndex().field_index() == Heap::kArgumentsLengthIndex); |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2468 Handle<Name> key = Handle<Name>(descs->GetKey(i)); | 2468 Handle<Name> key = Handle<Name>(descs->GetKey(i)); |
| 2469 int index = descs->GetFieldIndex(i); | 2469 int index = descs->GetFieldIndex(i); |
| 2470 ASSERT(!descs->GetDetails(i).representation().IsDouble()); | 2470 ASSERT(!descs->GetDetails(i).representation().IsDouble()); |
| 2471 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index), | 2471 Handle<Object> value = Handle<Object>(from->RawFastPropertyAt(index), |
| 2472 isolate()); | 2472 isolate()); |
| 2473 CHECK_NOT_EMPTY_HANDLE(isolate(), | 2473 CHECK_NOT_EMPTY_HANDLE(isolate(), |
| 2474 JSObject::SetLocalPropertyIgnoreAttributes( | 2474 JSObject::SetLocalPropertyIgnoreAttributes( |
| 2475 to, key, value, details.attributes())); | 2475 to, key, value, details.attributes())); |
| 2476 break; | 2476 break; |
| 2477 } | 2477 } |
| 2478 case CONSTANT_FUNCTION: { | 2478 case CONSTANT: { |
| 2479 HandleScope inner(isolate()); | 2479 HandleScope inner(isolate()); |
| 2480 Handle<Name> key = Handle<Name>(descs->GetKey(i)); | 2480 Handle<Name> key = Handle<Name>(descs->GetKey(i)); |
| 2481 Handle<JSFunction> fun = | 2481 Handle<Object> constant(descs->GetConstant(i), isolate()); |
| 2482 Handle<JSFunction>(descs->GetConstantFunction(i)); | |
| 2483 CHECK_NOT_EMPTY_HANDLE(isolate(), | 2482 CHECK_NOT_EMPTY_HANDLE(isolate(), |
| 2484 JSObject::SetLocalPropertyIgnoreAttributes( | 2483 JSObject::SetLocalPropertyIgnoreAttributes( |
| 2485 to, key, fun, details.attributes())); | 2484 to, key, constant, details.attributes())); |
| 2486 break; | 2485 break; |
| 2487 } | 2486 } |
| 2488 case CALLBACKS: { | 2487 case CALLBACKS: { |
| 2489 LookupResult result(isolate()); | 2488 LookupResult result(isolate()); |
| 2490 to->LocalLookup(descs->GetKey(i), &result); | 2489 to->LocalLookup(descs->GetKey(i), &result); |
| 2491 // If the property is already there we skip it | 2490 // If the property is already there we skip it |
| 2492 if (result.IsFound()) continue; | 2491 if (result.IsFound()) continue; |
| 2493 HandleScope inner(isolate()); | 2492 HandleScope inner(isolate()); |
| 2494 ASSERT(!to->HasFastProperties()); | 2493 ASSERT(!to->HasFastProperties()); |
| 2495 // Add to dictionary. | 2494 // Add to dictionary. |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2675 return from + sizeof(NestingCounterType); | 2674 return from + sizeof(NestingCounterType); |
| 2676 } | 2675 } |
| 2677 | 2676 |
| 2678 | 2677 |
| 2679 // Called when the top-level V8 mutex is destroyed. | 2678 // Called when the top-level V8 mutex is destroyed. |
| 2680 void Bootstrapper::FreeThreadResources() { | 2679 void Bootstrapper::FreeThreadResources() { |
| 2681 ASSERT(!IsActive()); | 2680 ASSERT(!IsActive()); |
| 2682 } | 2681 } |
| 2683 | 2682 |
| 2684 } } // namespace v8::internal | 2683 } } // namespace v8::internal |
| OLD | NEW |