OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 11249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11260 GetElementsKind(), new_elements); | 11260 GetElementsKind(), new_elements); |
11261 } | 11261 } |
11262 | 11262 |
11263 if (IsJSArray()) { | 11263 if (IsJSArray()) { |
11264 JSArray::cast(this)->set_length(Smi::FromInt(length)); | 11264 JSArray::cast(this)->set_length(Smi::FromInt(length)); |
11265 } | 11265 } |
11266 return new_elements; | 11266 return new_elements; |
11267 } | 11267 } |
11268 | 11268 |
11269 | 11269 |
11270 bool Code::IsWeakEmbeddedObject(Kind kind, Object* object) { | |
11271 if (kind != Code::OPTIMIZED_FUNCTION) return false; | |
11272 | |
11273 if (object->IsMap()) { | |
11274 return Map::cast(object)->CanTransition() && | |
11275 FLAG_collect_maps && | |
11276 FLAG_weak_embedded_maps_in_optimized_code; | |
11277 } | |
11278 | |
11279 if (object->IsJSObject() || | |
11280 (object->IsCell() && Cell::cast(object)->value()->IsJSObject())) { | |
11281 return FLAG_weak_embedded_objects_in_optimized_code; | |
11282 } | |
11283 | |
11284 return false; | |
11285 } | |
11286 | |
11287 | |
11288 void JSObject::SetFastDoubleElementsCapacityAndLength(Handle<JSObject> object, | 11270 void JSObject::SetFastDoubleElementsCapacityAndLength(Handle<JSObject> object, |
11289 int capacity, | 11271 int capacity, |
11290 int length) { | 11272 int length) { |
11291 CALL_HEAP_FUNCTION_VOID( | 11273 CALL_HEAP_FUNCTION_VOID( |
11292 object->GetIsolate(), | 11274 object->GetIsolate(), |
11293 object->SetFastDoubleElementsCapacityAndLength(capacity, length)); | 11275 object->SetFastDoubleElementsCapacityAndLength(capacity, length)); |
11294 } | 11276 } |
11295 | 11277 |
11296 | 11278 |
11297 MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength( | 11279 MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength( |
(...skipping 5198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16496 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16478 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16497 static const char* error_messages_[] = { | 16479 static const char* error_messages_[] = { |
16498 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16480 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16499 }; | 16481 }; |
16500 #undef ERROR_MESSAGES_TEXTS | 16482 #undef ERROR_MESSAGES_TEXTS |
16501 return error_messages_[reason]; | 16483 return error_messages_[reason]; |
16502 } | 16484 } |
16503 | 16485 |
16504 | 16486 |
16505 } } // namespace v8::internal | 16487 } } // namespace v8::internal |
OLD | NEW |