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

Side by Side Diff: src/mips/codegen-mips.cc

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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/mips/codegen-mips.h ('k') | src/mips/debug-mips.cc » ('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 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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 if (temp2.code() < temp3.code()) { 1016 if (temp2.code() < temp3.code()) {
1017 __ sll(at, temp1, 20); 1017 __ sll(at, temp1, 20);
1018 __ Or(temp1, temp3, at); 1018 __ Or(temp1, temp3, at);
1019 __ Move(double_scratch1, temp2, temp1); 1019 __ Move(double_scratch1, temp2, temp1);
1020 } else { 1020 } else {
1021 __ sll(at, temp1, 20); 1021 __ sll(at, temp1, 20);
1022 __ Or(temp1, temp2, at); 1022 __ Or(temp1, temp2, at);
1023 __ Move(double_scratch1, temp3, temp1); 1023 __ Move(double_scratch1, temp3, temp1);
1024 } 1024 }
1025 __ mul_d(result, result, double_scratch1); 1025 __ mul_d(result, result, double_scratch1);
1026 __ Branch(&done); 1026 __ BranchShort(&done);
1027 1027
1028 __ bind(&zero); 1028 __ bind(&zero);
1029 __ Move(result, kDoubleRegZero); 1029 __ Move(result, kDoubleRegZero);
1030 __ Branch(&done); 1030 __ BranchShort(&done);
1031 1031
1032 __ bind(&infinity); 1032 __ bind(&infinity);
1033 __ ldc1(result, ExpConstant(2, temp3)); 1033 __ ldc1(result, ExpConstant(2, temp3));
1034 1034
1035 __ bind(&done); 1035 __ bind(&done);
1036 } 1036 }
1037 1037
1038 #ifdef DEBUG 1038 #ifdef DEBUG
1039 // nop(CODE_AGE_MARKER_NOP) 1039 // nop(CODE_AGE_MARKER_NOP)
1040 static const uint32_t kCodeAgePatchFirstInstruction = 0x00010180; 1040 static const uint32_t kCodeAgePatchFirstInstruction = 0x00010180;
1041 #endif 1041 #endif
1042 1042
1043 static byte* GetNoCodeAgeSequence(uint32_t* length) { 1043 static byte* GetNoCodeAgeSequence(uint32_t* length) {
1044 // The sequence of instructions that is patched out for aging code is the 1044 // The sequence of instructions that is patched out for aging code is the
1045 // following boilerplate stack-building prologue that is found in FUNCTIONS 1045 // following boilerplate stack-building prologue that is found in FUNCTIONS
1046 static bool initialized = false; 1046 static bool initialized = false;
1047 static uint32_t sequence[kNoCodeAgeSequenceLength]; 1047 static uint32_t sequence[kNoCodeAgeSequenceLength];
1048 byte* byte_sequence = reinterpret_cast<byte*>(sequence); 1048 byte* byte_sequence = reinterpret_cast<byte*>(sequence);
1049 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize; 1049 *length = kNoCodeAgeSequenceLength * Assembler::kInstrSize;
1050 if (!initialized) { 1050 if (!initialized) {
1051 CodePatcher patcher(byte_sequence, kNoCodeAgeSequenceLength); 1051 // Since patcher is a large object, allocate it dynamically when needed,
1052 patcher.masm()->Push(ra, fp, cp, a1); 1052 // to avoid overloading the stack in stress conditions.
1053 patcher.masm()->nop(Assembler::CODE_AGE_SEQUENCE_NOP); 1053 SmartPointer<CodePatcher>
1054 patcher.masm()->Addu(fp, sp, 1054 patcher(new CodePatcher(byte_sequence, kNoCodeAgeSequenceLength));
1055 Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); 1055 PredictableCodeSizeScope scope(patcher->masm(), *length);
1056 patcher->masm()->Push(ra, fp, cp, a1);
1057 patcher->masm()->nop(Assembler::CODE_AGE_SEQUENCE_NOP);
1058 patcher->masm()->Addu(
1059 fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp));
1056 initialized = true; 1060 initialized = true;
1057 } 1061 }
1058 return byte_sequence; 1062 return byte_sequence;
1059 } 1063 }
1060 1064
1061 1065
1062 bool Code::IsYoungSequence(byte* sequence) { 1066 bool Code::IsYoungSequence(byte* sequence) {
1063 uint32_t young_length; 1067 uint32_t young_length;
1064 byte* young_sequence = GetNoCodeAgeSequence(&young_length); 1068 byte* young_sequence = GetNoCodeAgeSequence(&young_length);
1065 bool result = !memcmp(sequence, young_sequence, young_length); 1069 bool result = !memcmp(sequence, young_sequence, young_length);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 patcher.masm()->nop(); // Pad the empty space. 1113 patcher.masm()->nop(); // Pad the empty space.
1110 } 1114 }
1111 } 1115 }
1112 1116
1113 1117
1114 #undef __ 1118 #undef __
1115 1119
1116 } } // namespace v8::internal 1120 } } // namespace v8::internal
1117 1121
1118 #endif // V8_TARGET_ARCH_MIPS 1122 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/codegen-mips.h ('k') | src/mips/debug-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698