Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 // Return 1/0 for true/false in rax. | 248 // Return 1/0 for true/false in rax. |
| 249 __ bind(&true_result); | 249 __ bind(&true_result); |
| 250 __ movq(rax, Immediate(1)); | 250 __ movq(rax, Immediate(1)); |
| 251 __ ret(1 * kPointerSize); | 251 __ ret(1 * kPointerSize); |
| 252 __ bind(&false_result); | 252 __ bind(&false_result); |
| 253 __ Set(rax, 0); | 253 __ Set(rax, 0); |
| 254 __ ret(1 * kPointerSize); | 254 __ ret(1 * kPointerSize); |
| 255 } | 255 } |
| 256 | 256 |
| 257 | 257 |
| 258 void WriteBufferOverflowStub::Generate(MacroAssembler* masm) { | |
| 259 // We don't allow a GC during a write buffer overflow so there is no need to | |
| 260 // store the registers in any particular way, but we do have to store and | |
| 261 // restore them. | |
| 262 __ push(rax); | |
|
Vyacheslav Egorov (Chromium)
2011/01/06 12:35:29
Does it make sense to make something like
static
| |
| 263 __ push(rcx); | |
| 264 __ push(rdx); | |
| 265 __ push(rbx); | |
| 266 __ push(rbp); | |
| 267 __ push(rsi); | |
| 268 __ push(rdi); | |
| 269 __ push(r8); | |
| 270 __ push(r9); | |
| 271 __ push(r10); | |
| 272 __ push(r11); | |
| 273 // R12 to r15 are callee save on all platforms. | |
| 274 if (save_doubles_ == kSaveFPRegs) { | |
| 275 CpuFeatures::Scope scope(SSE2); | |
| 276 __ subq(rsp, Immediate(kDoubleSize * XMMRegister::kNumRegisters)); | |
| 277 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | |
| 278 XMMRegister reg = XMMRegister::from_code(i); | |
| 279 __ movsd(Operand(rsp, i * kDoubleSize), reg); | |
| 280 } | |
| 281 } | |
| 282 const int argument_count = 0; | |
| 283 __ PrepareCallCFunction(argument_count); | |
| 284 ExternalReference write_buffer_overflow = | |
| 285 ExternalReference(Runtime::FunctionForId(Runtime::kWriteBufferOverflow)); | |
| 286 __ CallCFunction(write_buffer_overflow, argument_count); | |
| 287 if (save_doubles_ == kSaveFPRegs) { | |
| 288 CpuFeatures::Scope scope(SSE2); | |
| 289 for (int i = 0; i < XMMRegister::kNumRegisters; i++) { | |
| 290 XMMRegister reg = XMMRegister::from_code(i); | |
| 291 __ movsd(reg, Operand(rsp, i * kDoubleSize)); | |
| 292 } | |
| 293 __ addq(rsp, Immediate(kDoubleSize * XMMRegister::kNumRegisters)); | |
| 294 } | |
| 295 __ pop(r11); | |
| 296 __ pop(r10); | |
| 297 __ pop(r9); | |
| 298 __ pop(r8); | |
| 299 __ pop(rdi); | |
| 300 __ pop(rsi); | |
| 301 __ pop(rbp); | |
| 302 __ pop(rbx); | |
| 303 __ pop(rdx); | |
| 304 __ pop(rcx); | |
| 305 __ pop(rax); | |
| 306 __ ret(0); | |
| 307 } | |
| 308 | |
| 309 | |
| 258 const char* GenericBinaryOpStub::GetName() { | 310 const char* GenericBinaryOpStub::GetName() { |
| 259 if (name_ != NULL) return name_; | 311 if (name_ != NULL) return name_; |
| 260 const int kMaxNameLength = 100; | 312 const int kMaxNameLength = 100; |
| 261 name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength); | 313 name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength); |
| 262 if (name_ == NULL) return "OOM"; | 314 if (name_ == NULL) return "OOM"; |
| 263 const char* op_name = Token::Name(op_); | 315 const char* op_name = Token::Name(op_); |
| 264 const char* overwrite_name; | 316 const char* overwrite_name; |
| 265 switch (mode_) { | 317 switch (mode_) { |
| 266 case NO_OVERWRITE: overwrite_name = "Alloc"; break; | 318 case NO_OVERWRITE: overwrite_name = "Alloc"; break; |
| 267 case OVERWRITE_RIGHT: overwrite_name = "OverwriteRight"; break; | 319 case OVERWRITE_RIGHT: overwrite_name = "OverwriteRight"; break; |
| (...skipping 1696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1964 | 2016 |
| 1965 // rbx: last_match_info backing store (FixedArray) | 2017 // rbx: last_match_info backing store (FixedArray) |
| 1966 // rdx: number of capture registers | 2018 // rdx: number of capture registers |
| 1967 // Store the capture count. | 2019 // Store the capture count. |
| 1968 __ Integer32ToSmi(kScratchRegister, rdx); | 2020 __ Integer32ToSmi(kScratchRegister, rdx); |
| 1969 __ movq(FieldOperand(rbx, RegExpImpl::kLastCaptureCountOffset), | 2021 __ movq(FieldOperand(rbx, RegExpImpl::kLastCaptureCountOffset), |
| 1970 kScratchRegister); | 2022 kScratchRegister); |
| 1971 // Store last subject and last input. | 2023 // Store last subject and last input. |
| 1972 __ movq(rax, Operand(rsp, kSubjectOffset)); | 2024 __ movq(rax, Operand(rsp, kSubjectOffset)); |
| 1973 __ movq(FieldOperand(rbx, RegExpImpl::kLastSubjectOffset), rax); | 2025 __ movq(FieldOperand(rbx, RegExpImpl::kLastSubjectOffset), rax); |
| 1974 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER | |
| 1975 __ movq(rcx, rbx); | 2026 __ movq(rcx, rbx); |
| 1976 __ RecordWrite(rcx, RegExpImpl::kLastSubjectOffset, rax, rdi); | 2027 __ RecordWrite(rcx, |
| 1977 #endif | 2028 RegExpImpl::kLastSubjectOffset, |
| 2029 rax, | |
| 2030 rdi, | |
| 2031 kDontSaveFPRegs); | |
| 1978 __ movq(rax, Operand(rsp, kSubjectOffset)); | 2032 __ movq(rax, Operand(rsp, kSubjectOffset)); |
| 1979 __ movq(FieldOperand(rbx, RegExpImpl::kLastInputOffset), rax); | 2033 __ movq(FieldOperand(rbx, RegExpImpl::kLastInputOffset), rax); |
| 1980 #ifdef ENABLE_CARDMARKING_WRITE_BARRIER | |
| 1981 __ movq(rcx, rbx); | 2034 __ movq(rcx, rbx); |
| 1982 __ RecordWrite(rcx, RegExpImpl::kLastInputOffset, rax, rdi); | 2035 __ RecordWrite(rcx, RegExpImpl::kLastInputOffset, rax, rdi, kDontSaveFPRegs); |
| 1983 #endif | |
| 1984 | 2036 |
| 1985 // Get the static offsets vector filled by the native regexp code. | 2037 // Get the static offsets vector filled by the native regexp code. |
| 1986 __ movq(rcx, ExternalReference::address_of_static_offsets_vector()); | 2038 __ movq(rcx, ExternalReference::address_of_static_offsets_vector()); |
| 1987 | 2039 |
| 1988 // rbx: last_match_info backing store (FixedArray) | 2040 // rbx: last_match_info backing store (FixedArray) |
| 1989 // rcx: offsets vector | 2041 // rcx: offsets vector |
| 1990 // rdx: number of capture registers | 2042 // rdx: number of capture registers |
| 1991 NearLabel next_capture, done; | 2043 NearLabel next_capture, done; |
| 1992 // Capture register counter starts from number of capture registers and | 2044 // Capture register counter starts from number of capture registers and |
| 1993 // counts down until wraping after zero. | 2045 // counts down until wraping after zero. |
| (...skipping 2111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4105 | 4157 |
| 4106 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { | 4158 void ICCompareStub::GenerateMiss(MacroAssembler* masm) { |
| 4107 UNIMPLEMENTED(); | 4159 UNIMPLEMENTED(); |
| 4108 } | 4160 } |
| 4109 | 4161 |
| 4110 #undef __ | 4162 #undef __ |
| 4111 | 4163 |
| 4112 } } // namespace v8::internal | 4164 } } // namespace v8::internal |
| 4113 | 4165 |
| 4114 #endif // V8_TARGET_ARCH_X64 | 4166 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |