| 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 1825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 // on Array.prototype and below. | 1836 // on Array.prototype and below. |
| 1837 prototype->set_elements(isolate->heap()->empty_fixed_array()); | 1837 prototype->set_elements(isolate->heap()->empty_fixed_array()); |
| 1838 return Smi::FromInt(0); | 1838 return Smi::FromInt(0); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 | 1841 |
| 1842 static Handle<JSFunction> InstallBuiltin(Isolate* isolate, | 1842 static Handle<JSFunction> InstallBuiltin(Isolate* isolate, |
| 1843 Handle<JSObject> holder, | 1843 Handle<JSObject> holder, |
| 1844 const char* name, | 1844 const char* name, |
| 1845 Builtins::Name builtin_name) { | 1845 Builtins::Name builtin_name) { |
| 1846 Handle<String> key = isolate->factory()->LookupAsciiSymbol(name); | 1846 Handle<String> key = isolate->factory()->LookupUtf8Symbol(name); |
| 1847 Handle<Code> code(isolate->builtins()->builtin(builtin_name)); | 1847 Handle<Code> code(isolate->builtins()->builtin(builtin_name)); |
| 1848 Handle<JSFunction> optimized = | 1848 Handle<JSFunction> optimized = |
| 1849 isolate->factory()->NewFunction(key, | 1849 isolate->factory()->NewFunction(key, |
| 1850 JS_OBJECT_TYPE, | 1850 JS_OBJECT_TYPE, |
| 1851 JSObject::kHeaderSize, | 1851 JSObject::kHeaderSize, |
| 1852 code, | 1852 code, |
| 1853 false); | 1853 false); |
| 1854 optimized->shared()->DontAdaptArguments(); | 1854 optimized->shared()->DontAdaptArguments(); |
| 1855 JSReceiver::SetProperty(holder, key, optimized, NONE, kStrictMode); | 1855 JSReceiver::SetProperty(holder, key, optimized, NONE, kStrictMode); |
| 1856 return optimized; | 1856 return optimized; |
| (...skipping 5980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7837 Compiler::RecompileParallel(args.at<JSFunction>(0)); | 7837 Compiler::RecompileParallel(args.at<JSFunction>(0)); |
| 7838 return isolate->heap()->undefined_value(); | 7838 return isolate->heap()->undefined_value(); |
| 7839 } | 7839 } |
| 7840 | 7840 |
| 7841 | 7841 |
| 7842 RUNTIME_FUNCTION(MaybeObject*, Runtime_ForceParallelRecompile) { | 7842 RUNTIME_FUNCTION(MaybeObject*, Runtime_ForceParallelRecompile) { |
| 7843 if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value(); | 7843 if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value(); |
| 7844 HandleScope handle_scope(isolate); | 7844 HandleScope handle_scope(isolate); |
| 7845 ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation); | 7845 ASSERT(FLAG_parallel_recompilation && FLAG_manual_parallel_recompilation); |
| 7846 if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { | 7846 if (!isolate->optimizing_compiler_thread()->IsQueueAvailable()) { |
| 7847 return isolate->Throw( | 7847 return isolate->Throw(*isolate->factory()->LookupOneByteSymbol( |
| 7848 *isolate->factory()->LookupAsciiSymbol("Recompile queue is full.")); | 7848 STATIC_ASCII_VECTOR("Recompile queue is full."))); |
| 7849 } | 7849 } |
| 7850 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); | 7850 CONVERT_ARG_HANDLE_CHECKED(JSFunction, fun, 0); |
| 7851 fun->ReplaceCode(isolate->builtins()->builtin(Builtins::kParallelRecompile)); | 7851 fun->ReplaceCode(isolate->builtins()->builtin(Builtins::kParallelRecompile)); |
| 7852 Compiler::RecompileParallel(fun); | 7852 Compiler::RecompileParallel(fun); |
| 7853 return isolate->heap()->undefined_value(); | 7853 return isolate->heap()->undefined_value(); |
| 7854 } | 7854 } |
| 7855 | 7855 |
| 7856 | 7856 |
| 7857 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) { | 7857 RUNTIME_FUNCTION(MaybeObject*, Runtime_InstallRecompiledCode) { |
| 7858 if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value(); | 7858 if (!V8::UseCrankshaft()) return isolate->heap()->undefined_value(); |
| (...skipping 4943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12802 JavaScriptFrameIterator it(isolate, id); | 12802 JavaScriptFrameIterator it(isolate, id); |
| 12803 for (; !it.done(); it.Advance()) { | 12803 for (; !it.done(); it.Advance()) { |
| 12804 if (index < count + it.frame()->GetInlineCount()) break; | 12804 if (index < count + it.frame()->GetInlineCount()) break; |
| 12805 count += it.frame()->GetInlineCount(); | 12805 count += it.frame()->GetInlineCount(); |
| 12806 } | 12806 } |
| 12807 if (it.done()) return heap->undefined_value(); | 12807 if (it.done()) return heap->undefined_value(); |
| 12808 | 12808 |
| 12809 const char* error_message = | 12809 const char* error_message = |
| 12810 LiveEdit::RestartFrame(it.frame(), isolate->runtime_zone()); | 12810 LiveEdit::RestartFrame(it.frame(), isolate->runtime_zone()); |
| 12811 if (error_message) { | 12811 if (error_message) { |
| 12812 return *(isolate->factory()->LookupAsciiSymbol(error_message)); | 12812 return *(isolate->factory()->LookupUtf8Symbol(error_message)); |
| 12813 } | 12813 } |
| 12814 return heap->true_value(); | 12814 return heap->true_value(); |
| 12815 } | 12815 } |
| 12816 | 12816 |
| 12817 | 12817 |
| 12818 // A testing entry. Returns statement position which is the closest to | 12818 // A testing entry. Returns statement position which is the closest to |
| 12819 // source_position. | 12819 // source_position. |
| 12820 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFunctionCodePositionFromSource) { | 12820 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFunctionCodePositionFromSource) { |
| 12821 CHECK(isolate->debugger()->live_edit_enabled()); | 12821 CHECK(isolate->debugger()->live_edit_enabled()); |
| 12822 ASSERT(args.length() == 2); | 12822 ASSERT(args.length() == 2); |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13579 | 13579 |
| 13580 | 13580 |
| 13581 MaybeObject* Runtime::InitializeIntrinsicFunctionNames(Heap* heap, | 13581 MaybeObject* Runtime::InitializeIntrinsicFunctionNames(Heap* heap, |
| 13582 Object* dictionary) { | 13582 Object* dictionary) { |
| 13583 ASSERT(Isolate::Current()->heap() == heap); | 13583 ASSERT(Isolate::Current()->heap() == heap); |
| 13584 ASSERT(dictionary != NULL); | 13584 ASSERT(dictionary != NULL); |
| 13585 ASSERT(StringDictionary::cast(dictionary)->NumberOfElements() == 0); | 13585 ASSERT(StringDictionary::cast(dictionary)->NumberOfElements() == 0); |
| 13586 for (int i = 0; i < kNumFunctions; ++i) { | 13586 for (int i = 0; i < kNumFunctions; ++i) { |
| 13587 Object* name_symbol; | 13587 Object* name_symbol; |
| 13588 { MaybeObject* maybe_name_symbol = | 13588 { MaybeObject* maybe_name_symbol = |
| 13589 heap->LookupAsciiSymbol(kIntrinsicFunctions[i].name); | 13589 heap->LookupUtf8Symbol(kIntrinsicFunctions[i].name); |
| 13590 if (!maybe_name_symbol->ToObject(&name_symbol)) return maybe_name_symbol; | 13590 if (!maybe_name_symbol->ToObject(&name_symbol)) return maybe_name_symbol; |
| 13591 } | 13591 } |
| 13592 StringDictionary* string_dictionary = StringDictionary::cast(dictionary); | 13592 StringDictionary* string_dictionary = StringDictionary::cast(dictionary); |
| 13593 { MaybeObject* maybe_dictionary = string_dictionary->Add( | 13593 { MaybeObject* maybe_dictionary = string_dictionary->Add( |
| 13594 String::cast(name_symbol), | 13594 String::cast(name_symbol), |
| 13595 Smi::FromInt(i), | 13595 Smi::FromInt(i), |
| 13596 PropertyDetails(NONE, NORMAL)); | 13596 PropertyDetails(NONE, NORMAL)); |
| 13597 if (!maybe_dictionary->ToObject(&dictionary)) { | 13597 if (!maybe_dictionary->ToObject(&dictionary)) { |
| 13598 // Non-recoverable failure. Calling code must restart heap | 13598 // Non-recoverable failure. Calling code must restart heap |
| 13599 // initialization. | 13599 // initialization. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13638 // Handle last resort GC and make sure to allow future allocations | 13638 // Handle last resort GC and make sure to allow future allocations |
| 13639 // to grow the heap without causing GCs (if possible). | 13639 // to grow the heap without causing GCs (if possible). |
| 13640 isolate->counters()->gc_last_resort_from_js()->Increment(); | 13640 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 13641 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 13641 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 13642 "Runtime::PerformGC"); | 13642 "Runtime::PerformGC"); |
| 13643 } | 13643 } |
| 13644 } | 13644 } |
| 13645 | 13645 |
| 13646 | 13646 |
| 13647 } } // namespace v8::internal | 13647 } } // namespace v8::internal |
| OLD | NEW |