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

Side by Side Diff: src/arm/lithium-arm.cc

Issue 6142011: Crankshaft: Move LEnvironment and LPointerMap classes to platform-independent... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 11 months 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
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 int index = chunk_->AddInstruction(instr, current_block_); 880 int index = chunk_->AddInstruction(instr, current_block_);
881 allocator_->SummarizeInstruction(index); 881 allocator_->SummarizeInstruction(index);
882 } else { 882 } else {
883 // This instruction should be omitted. 883 // This instruction should be omitted.
884 allocator_->OmitInstruction(); 884 allocator_->OmitInstruction();
885 } 885 }
886 current_instruction_ = old_current; 886 current_instruction_ = old_current;
887 } 887 }
888 888
889 889
890 void LEnvironment::WriteTranslation(LCodeGen* cgen,
891 Translation* translation) const {
892 if (this == NULL) return;
893
894 // The translation includes one command per value in the environment.
895 int translation_size = values()->length();
896 // The output frame height does not include the parameters.
897 int height = translation_size - parameter_count();
898
899 outer()->WriteTranslation(cgen, translation);
900 int closure_id = cgen->DefineDeoptimizationLiteral(closure());
901 translation->BeginFrame(ast_id(), closure_id, height);
902 for (int i = 0; i < translation_size; ++i) {
903 LOperand* value = values()->at(i);
904 // spilled_registers_ and spilled_double_registers_ are either
905 // both NULL or both set.
906 if (spilled_registers_ != NULL && value != NULL) {
907 if (value->IsRegister() &&
908 spilled_registers_[value->index()] != NULL) {
909 translation->MarkDuplicate();
910 cgen->AddToTranslation(translation,
911 spilled_registers_[value->index()],
912 HasTaggedValueAt(i));
913 } else if (value->IsDoubleRegister() &&
914 spilled_double_registers_[value->index()] != NULL) {
915 translation->MarkDuplicate();
916 cgen->AddToTranslation(translation,
917 spilled_double_registers_[value->index()],
918 false);
919 }
920 }
921
922 cgen->AddToTranslation(translation, value, HasTaggedValueAt(i));
923 }
924 }
925
926
927 void LEnvironment::PrintTo(StringStream* stream) const {
928 stream->Add("[id=%d|", ast_id());
929 stream->Add("[parameters=%d|", parameter_count());
930 stream->Add("[arguments_stack_height=%d|", arguments_stack_height());
931 for (int i = 0; i < values_.length(); ++i) {
932 if (i != 0) stream->Add(";");
933 if (values_[i] == NULL) {
934 stream->Add("[hole]");
935 } else {
936 values_[i]->PrintTo(stream);
937 }
938 }
939 stream->Add("]");
940 }
941
942
943 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) { 890 LEnvironment* LChunkBuilder::CreateEnvironment(HEnvironment* hydrogen_env) {
944 if (hydrogen_env == NULL) return NULL; 891 if (hydrogen_env == NULL) return NULL;
945 892
946 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer()); 893 LEnvironment* outer = CreateEnvironment(hydrogen_env->outer());
947 int ast_id = hydrogen_env->ast_id(); 894 int ast_id = hydrogen_env->ast_id();
948 ASSERT(ast_id != AstNode::kNoNumber); 895 ASSERT(ast_id != AstNode::kNoNumber);
949 int value_count = hydrogen_env->length(); 896 int value_count = hydrogen_env->length();
950 LEnvironment* result = new LEnvironment(hydrogen_env->closure(), 897 LEnvironment* result = new LEnvironment(hydrogen_env->closure(),
951 ast_id, 898 ast_id,
952 hydrogen_env->parameter_count(), 899 hydrogen_env->parameter_count(),
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 } 1838 }
1892 1839
1893 1840
1894 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1841 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1895 HEnvironment* outer = current_block_->last_environment()->outer(); 1842 HEnvironment* outer = current_block_->last_environment()->outer();
1896 current_block_->UpdateEnvironment(outer); 1843 current_block_->UpdateEnvironment(outer);
1897 return NULL; 1844 return NULL;
1898 } 1845 }
1899 1846
1900 1847
1901 void LPointerMap::RecordPointer(LOperand* op) {
1902 // Do not record arguments as pointers.
1903 if (op->IsStackSlot() && op->index() < 0) return;
1904 ASSERT(!op->IsDoubleRegister() && !op->IsDoubleStackSlot());
1905 pointer_operands_.Add(op);
1906 }
1907
1908
1909 void LPointerMap::PrintTo(StringStream* stream) const {
1910 stream->Add("{");
1911 for (int i = 0; i < pointer_operands_.length(); ++i) {
1912 if (i != 0) stream->Add(";");
1913 pointer_operands_[i]->PrintTo(stream);
1914 }
1915 stream->Add("} @%d", position());
1916 }
1917
1918 } } // namespace v8::internal 1848 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.h ('k') | src/arm/lithium-codegen-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698