| 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 14584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14595 | 14595 |
| 14596 static const Runtime::Function kIntrinsicFunctions[] = { | 14596 static const Runtime::Function kIntrinsicFunctions[] = { |
| 14597 RUNTIME_FUNCTION_LIST(F) | 14597 RUNTIME_FUNCTION_LIST(F) |
| 14598 INLINE_FUNCTION_LIST(I) | 14598 INLINE_FUNCTION_LIST(I) |
| 14599 INLINE_RUNTIME_FUNCTION_LIST(I) | 14599 INLINE_RUNTIME_FUNCTION_LIST(I) |
| 14600 }; | 14600 }; |
| 14601 | 14601 |
| 14602 | 14602 |
| 14603 MaybeObject* Runtime::InitializeIntrinsicFunctionNames(Heap* heap, | 14603 MaybeObject* Runtime::InitializeIntrinsicFunctionNames(Heap* heap, |
| 14604 Object* dictionary) { | 14604 Object* dictionary) { |
| 14605 ASSERT(Isolate::Current()->heap() == heap); | |
| 14606 ASSERT(dictionary != NULL); | 14605 ASSERT(dictionary != NULL); |
| 14607 ASSERT(NameDictionary::cast(dictionary)->NumberOfElements() == 0); | 14606 ASSERT(NameDictionary::cast(dictionary)->NumberOfElements() == 0); |
| 14608 for (int i = 0; i < kNumFunctions; ++i) { | 14607 for (int i = 0; i < kNumFunctions; ++i) { |
| 14609 Object* name_string; | 14608 Object* name_string; |
| 14610 { MaybeObject* maybe_name_string = | 14609 { MaybeObject* maybe_name_string = |
| 14611 heap->InternalizeUtf8String(kIntrinsicFunctions[i].name); | 14610 heap->InternalizeUtf8String(kIntrinsicFunctions[i].name); |
| 14612 if (!maybe_name_string->ToObject(&name_string)) return maybe_name_string; | 14611 if (!maybe_name_string->ToObject(&name_string)) return maybe_name_string; |
| 14613 } | 14612 } |
| 14614 NameDictionary* name_dictionary = NameDictionary::cast(dictionary); | 14613 NameDictionary* name_dictionary = NameDictionary::cast(dictionary); |
| 14615 { MaybeObject* maybe_dictionary = name_dictionary->Add( | 14614 { MaybeObject* maybe_dictionary = name_dictionary->Add( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14660 // Handle last resort GC and make sure to allow future allocations | 14659 // Handle last resort GC and make sure to allow future allocations |
| 14661 // to grow the heap without causing GCs (if possible). | 14660 // to grow the heap without causing GCs (if possible). |
| 14662 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14661 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 14663 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14662 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 14664 "Runtime::PerformGC"); | 14663 "Runtime::PerformGC"); |
| 14665 } | 14664 } |
| 14666 } | 14665 } |
| 14667 | 14666 |
| 14668 | 14667 |
| 14669 } } // namespace v8::internal | 14668 } } // namespace v8::internal |
| OLD | NEW |