Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: src/runtime.cc

Issue 70203002: Simplify Hydrogen code stubs with variable argument count (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed smi-ification of variable arg count Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/deoptimizer.cc ('K') | « src/ia32/lithium-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14706 matching lines...) Expand 10 before | Expand all | Expand 10 after
14717 if (maybe_array->IsFailure()) return maybe_array; 14717 if (maybe_array->IsFailure()) return maybe_array;
14718 maybe_array = ArrayConstructInitializeElements(array, caller_args); 14718 maybe_array = ArrayConstructInitializeElements(array, caller_args);
14719 if (maybe_array->IsFailure()) return maybe_array; 14719 if (maybe_array->IsFailure()) return maybe_array;
14720 return array; 14720 return array;
14721 } 14721 }
14722 14722
14723 14723
14724 RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayConstructor) { 14724 RUNTIME_FUNCTION(MaybeObject*, Runtime_ArrayConstructor) {
14725 HandleScope scope(isolate); 14725 HandleScope scope(isolate);
14726 // If we get 2 arguments then they are the stub parameters (constructor, type 14726 // If we get 2 arguments then they are the stub parameters (constructor, type
14727 // info). If we get 3, then the first one is a pointer to the arguments 14727 // info). If we get 4, then the first one is a pointer to the arguments
14728 // passed by the caller. 14728 // passed by the caller, and the last one is the length of the arguments
14729 // passed to the caller (redundant, but useful to check on the deoptimizer
14730 // with an assert).
14729 Arguments empty_args(0, NULL); 14731 Arguments empty_args(0, NULL);
14730 bool no_caller_args = args.length() == 2; 14732 bool no_caller_args = args.length() == 2;
14731 ASSERT(no_caller_args || args.length() == 3); 14733 ASSERT(no_caller_args || args.length() == 4);
14732 int parameters_start = no_caller_args ? 0 : 1; 14734 int parameters_start = no_caller_args ? 0 : 1;
14733 Arguments* caller_args = no_caller_args 14735 Arguments* caller_args = no_caller_args
14734 ? &empty_args 14736 ? &empty_args
14735 : reinterpret_cast<Arguments*>(args[0]); 14737 : reinterpret_cast<Arguments*>(args[0]);
14736 CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, parameters_start); 14738 CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, parameters_start);
14737 CONVERT_ARG_HANDLE_CHECKED(Object, type_info, parameters_start + 1); 14739 CONVERT_ARG_HANDLE_CHECKED(Object, type_info, parameters_start + 1);
14738 14740 #ifdef DEBUG
14741 if (!no_caller_args) {
14742 CONVERT_SMI_ARG_CHECKED(arg_count, parameters_start + 2);
14743 ASSERT(arg_count == caller_args->length());
14744 }
14745 #endif
14739 return ArrayConstructorCommon(isolate, 14746 return ArrayConstructorCommon(isolate,
14740 constructor, 14747 constructor,
14741 type_info, 14748 type_info,
14742 caller_args); 14749 caller_args);
14743 } 14750 }
14744 14751
14745 14752
14746 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalArrayConstructor) { 14753 RUNTIME_FUNCTION(MaybeObject*, Runtime_InternalArrayConstructor) {
14747 HandleScope scope(isolate); 14754 HandleScope scope(isolate);
14748 Arguments empty_args(0, NULL); 14755 Arguments empty_args(0, NULL);
14749 bool no_caller_args = args.length() == 1; 14756 bool no_caller_args = args.length() == 1;
14750 ASSERT(no_caller_args || args.length() == 2); 14757 ASSERT(no_caller_args || args.length() == 3);
14751 int parameters_start = no_caller_args ? 0 : 1; 14758 int parameters_start = no_caller_args ? 0 : 1;
14752 Arguments* caller_args = no_caller_args 14759 Arguments* caller_args = no_caller_args
14753 ? &empty_args 14760 ? &empty_args
14754 : reinterpret_cast<Arguments*>(args[0]); 14761 : reinterpret_cast<Arguments*>(args[0]);
14755 CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, parameters_start); 14762 CONVERT_ARG_HANDLE_CHECKED(JSFunction, constructor, parameters_start);
14756 14763 #ifdef DEBUG
14764 if (!no_caller_args) {
14765 CONVERT_SMI_ARG_CHECKED(arg_count, parameters_start + 1);
14766 ASSERT(arg_count == caller_args->length());
14767 }
14768 #endif
14757 return ArrayConstructorCommon(isolate, 14769 return ArrayConstructorCommon(isolate,
14758 constructor, 14770 constructor,
14759 Handle<Object>::null(), 14771 Handle<Object>::null(),
14760 caller_args); 14772 caller_args);
14761 } 14773 }
14762 14774
14763 14775
14764 // ---------------------------------------------------------------------------- 14776 // ----------------------------------------------------------------------------
14765 // Implementation of Runtime 14777 // Implementation of Runtime
14766 14778
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
14838 // Handle last resort GC and make sure to allow future allocations 14850 // Handle last resort GC and make sure to allow future allocations
14839 // to grow the heap without causing GCs (if possible). 14851 // to grow the heap without causing GCs (if possible).
14840 isolate->counters()->gc_last_resort_from_js()->Increment(); 14852 isolate->counters()->gc_last_resort_from_js()->Increment();
14841 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 14853 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
14842 "Runtime::PerformGC"); 14854 "Runtime::PerformGC");
14843 } 14855 }
14844 } 14856 }
14845 14857
14846 14858
14847 } } // namespace v8::internal 14859 } } // namespace v8::internal
OLDNEW
« src/deoptimizer.cc ('K') | « src/ia32/lithium-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698