| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 CheckPageFlag(object, | 295 CheckPageFlag(object, |
| 296 value, // Used as scratch. | 296 value, // Used as scratch. |
| 297 MemoryChunk::kPointersFromHereAreInterestingMask, | 297 MemoryChunk::kPointersFromHereAreInterestingMask, |
| 298 eq, | 298 eq, |
| 299 &done); | 299 &done); |
| 300 | 300 |
| 301 // Record the actual write. | 301 // Record the actual write. |
| 302 if (ra_status == kRAHasNotBeenSaved) { | 302 if (ra_status == kRAHasNotBeenSaved) { |
| 303 push(ra); | 303 push(ra); |
| 304 } | 304 } |
| 305 RecordWriteStub stub(object, value, address, remembered_set_action, fp_mode); | 305 RecordWriteStub stub(isolate(), object, value, address, remembered_set_action, |
| 306 fp_mode); |
| 306 CallStub(&stub); | 307 CallStub(&stub); |
| 307 if (ra_status == kRAHasNotBeenSaved) { | 308 if (ra_status == kRAHasNotBeenSaved) { |
| 308 pop(ra); | 309 pop(ra); |
| 309 } | 310 } |
| 310 | 311 |
| 311 bind(&done); | 312 bind(&done); |
| 312 | 313 |
| 313 // Clobber clobbered registers when running with the debug-code flag | 314 // Clobber clobbered registers when running with the debug-code flag |
| 314 // turned on to provoke errors. | 315 // turned on to provoke errors. |
| 315 if (emit_debug_code()) { | 316 if (emit_debug_code()) { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 345 // Check for end of buffer. | 346 // Check for end of buffer. |
| 346 And(t8, scratch, Operand(StoreBuffer::kStoreBufferOverflowBit)); | 347 And(t8, scratch, Operand(StoreBuffer::kStoreBufferOverflowBit)); |
| 347 if (and_then == kFallThroughAtEnd) { | 348 if (and_then == kFallThroughAtEnd) { |
| 348 Branch(&done, eq, t8, Operand(zero_reg)); | 349 Branch(&done, eq, t8, Operand(zero_reg)); |
| 349 } else { | 350 } else { |
| 350 ASSERT(and_then == kReturnAtEnd); | 351 ASSERT(and_then == kReturnAtEnd); |
| 351 Ret(eq, t8, Operand(zero_reg)); | 352 Ret(eq, t8, Operand(zero_reg)); |
| 352 } | 353 } |
| 353 push(ra); | 354 push(ra); |
| 354 StoreBufferOverflowStub store_buffer_overflow = | 355 StoreBufferOverflowStub store_buffer_overflow = |
| 355 StoreBufferOverflowStub(fp_mode); | 356 StoreBufferOverflowStub(isolate(), fp_mode); |
| 356 CallStub(&store_buffer_overflow); | 357 CallStub(&store_buffer_overflow); |
| 357 pop(ra); | 358 pop(ra); |
| 358 bind(&done); | 359 bind(&done); |
| 359 if (and_then == kReturnAtEnd) { | 360 if (and_then == kReturnAtEnd) { |
| 360 Ret(); | 361 Ret(); |
| 361 } | 362 } |
| 362 } | 363 } |
| 363 | 364 |
| 364 | 365 |
| 365 // ----------------------------------------------------------------------------- | 366 // ----------------------------------------------------------------------------- |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1449 DoubleRegister double_input) { | 1450 DoubleRegister double_input) { |
| 1450 Label done; | 1451 Label done; |
| 1451 | 1452 |
| 1452 TryInlineTruncateDoubleToI(result, double_input, &done); | 1453 TryInlineTruncateDoubleToI(result, double_input, &done); |
| 1453 | 1454 |
| 1454 // If we fell through then inline version didn't succeed - call stub instead. | 1455 // If we fell through then inline version didn't succeed - call stub instead. |
| 1455 push(ra); | 1456 push(ra); |
| 1456 Subu(sp, sp, Operand(kDoubleSize)); // Put input on stack. | 1457 Subu(sp, sp, Operand(kDoubleSize)); // Put input on stack. |
| 1457 sdc1(double_input, MemOperand(sp, 0)); | 1458 sdc1(double_input, MemOperand(sp, 0)); |
| 1458 | 1459 |
| 1459 DoubleToIStub stub(sp, result, 0, true, true); | 1460 DoubleToIStub stub(isolate(), sp, result, 0, true, true); |
| 1460 CallStub(&stub); | 1461 CallStub(&stub); |
| 1461 | 1462 |
| 1462 Addu(sp, sp, Operand(kDoubleSize)); | 1463 Addu(sp, sp, Operand(kDoubleSize)); |
| 1463 pop(ra); | 1464 pop(ra); |
| 1464 | 1465 |
| 1465 bind(&done); | 1466 bind(&done); |
| 1466 } | 1467 } |
| 1467 | 1468 |
| 1468 | 1469 |
| 1469 void MacroAssembler::TruncateHeapNumberToI(Register result, Register object) { | 1470 void MacroAssembler::TruncateHeapNumberToI(Register result, Register object) { |
| 1470 Label done; | 1471 Label done; |
| 1471 DoubleRegister double_scratch = f12; | 1472 DoubleRegister double_scratch = f12; |
| 1472 ASSERT(!result.is(object)); | 1473 ASSERT(!result.is(object)); |
| 1473 | 1474 |
| 1474 ldc1(double_scratch, | 1475 ldc1(double_scratch, |
| 1475 MemOperand(object, HeapNumber::kValueOffset - kHeapObjectTag)); | 1476 MemOperand(object, HeapNumber::kValueOffset - kHeapObjectTag)); |
| 1476 TryInlineTruncateDoubleToI(result, double_scratch, &done); | 1477 TryInlineTruncateDoubleToI(result, double_scratch, &done); |
| 1477 | 1478 |
| 1478 // If we fell through then inline version didn't succeed - call stub instead. | 1479 // If we fell through then inline version didn't succeed - call stub instead. |
| 1479 push(ra); | 1480 push(ra); |
| 1480 DoubleToIStub stub(object, | 1481 DoubleToIStub stub(isolate(), |
| 1482 object, |
| 1481 result, | 1483 result, |
| 1482 HeapNumber::kValueOffset - kHeapObjectTag, | 1484 HeapNumber::kValueOffset - kHeapObjectTag, |
| 1483 true, | 1485 true, |
| 1484 true); | 1486 true); |
| 1485 CallStub(&stub); | 1487 CallStub(&stub); |
| 1486 pop(ra); | 1488 pop(ra); |
| 1487 | 1489 |
| 1488 bind(&done); | 1490 bind(&done); |
| 1489 } | 1491 } |
| 1490 | 1492 |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2684 li(at, Operand(handle)); | 2686 li(at, Operand(handle)); |
| 2685 push(at); | 2687 push(at); |
| 2686 } | 2688 } |
| 2687 | 2689 |
| 2688 | 2690 |
| 2689 #ifdef ENABLE_DEBUGGER_SUPPORT | 2691 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 2690 | 2692 |
| 2691 void MacroAssembler::DebugBreak() { | 2693 void MacroAssembler::DebugBreak() { |
| 2692 PrepareCEntryArgs(0); | 2694 PrepareCEntryArgs(0); |
| 2693 PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate())); | 2695 PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate())); |
| 2694 CEntryStub ces(1); | 2696 CEntryStub ces(isolate(), 1); |
| 2695 ASSERT(AllowThisStubCall(&ces)); | 2697 ASSERT(AllowThisStubCall(&ces)); |
| 2696 Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); | 2698 Call(ces.GetCode(isolate()), RelocInfo::DEBUG_BREAK); |
| 2697 } | 2699 } |
| 2698 | 2700 |
| 2699 #endif // ENABLE_DEBUGGER_SUPPORT | 2701 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2700 | 2702 |
| 2701 | 2703 |
| 2702 // --------------------------------------------------------------------------- | 2704 // --------------------------------------------------------------------------- |
| 2703 // Exception handling. | 2705 // Exception handling. |
| 2704 | 2706 |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3959 PushSafepointRegisters(); | 3961 PushSafepointRegisters(); |
| 3960 PrepareCallCFunction(1, a0); | 3962 PrepareCallCFunction(1, a0); |
| 3961 li(a0, Operand(ExternalReference::isolate_address(isolate()))); | 3963 li(a0, Operand(ExternalReference::isolate_address(isolate()))); |
| 3962 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); | 3964 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); |
| 3963 PopSafepointRegisters(); | 3965 PopSafepointRegisters(); |
| 3964 } | 3966 } |
| 3965 | 3967 |
| 3966 // Native call returns to the DirectCEntry stub which redirects to the | 3968 // Native call returns to the DirectCEntry stub which redirects to the |
| 3967 // return address pushed on stack (could have moved after GC). | 3969 // return address pushed on stack (could have moved after GC). |
| 3968 // DirectCEntry stub itself is generated early and never moves. | 3970 // DirectCEntry stub itself is generated early and never moves. |
| 3969 DirectCEntryStub stub; | 3971 DirectCEntryStub stub(isolate()); |
| 3970 stub.GenerateCall(this, t9); | 3972 stub.GenerateCall(this, t9); |
| 3971 | 3973 |
| 3972 if (FLAG_log_timer_events) { | 3974 if (FLAG_log_timer_events) { |
| 3973 FrameScope frame(this, StackFrame::MANUAL); | 3975 FrameScope frame(this, StackFrame::MANUAL); |
| 3974 PushSafepointRegisters(); | 3976 PushSafepointRegisters(); |
| 3975 PrepareCallCFunction(1, a0); | 3977 PrepareCallCFunction(1, a0); |
| 3976 li(a0, Operand(ExternalReference::isolate_address(isolate()))); | 3978 li(a0, Operand(ExternalReference::isolate_address(isolate()))); |
| 3977 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); | 3979 CallCFunction(ExternalReference::log_leave_external_function(isolate()), 1); |
| 3978 PopSafepointRegisters(); | 3980 PopSafepointRegisters(); |
| 3979 } | 3981 } |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4209 IllegalOperation(num_arguments); | 4211 IllegalOperation(num_arguments); |
| 4210 return; | 4212 return; |
| 4211 } | 4213 } |
| 4212 | 4214 |
| 4213 // TODO(1236192): Most runtime routines don't need the number of | 4215 // TODO(1236192): Most runtime routines don't need the number of |
| 4214 // arguments passed in because it is constant. At some point we | 4216 // arguments passed in because it is constant. At some point we |
| 4215 // should remove this need and make the runtime routine entry code | 4217 // should remove this need and make the runtime routine entry code |
| 4216 // smarter. | 4218 // smarter. |
| 4217 PrepareCEntryArgs(num_arguments); | 4219 PrepareCEntryArgs(num_arguments); |
| 4218 PrepareCEntryFunction(ExternalReference(f, isolate())); | 4220 PrepareCEntryFunction(ExternalReference(f, isolate())); |
| 4219 CEntryStub stub(1, save_doubles); | 4221 CEntryStub stub(isolate(), 1, save_doubles); |
| 4220 CallStub(&stub); | 4222 CallStub(&stub); |
| 4221 } | 4223 } |
| 4222 | 4224 |
| 4223 | 4225 |
| 4224 void MacroAssembler::CallExternalReference(const ExternalReference& ext, | 4226 void MacroAssembler::CallExternalReference(const ExternalReference& ext, |
| 4225 int num_arguments, | 4227 int num_arguments, |
| 4226 BranchDelaySlot bd) { | 4228 BranchDelaySlot bd) { |
| 4227 PrepareCEntryArgs(num_arguments); | 4229 PrepareCEntryArgs(num_arguments); |
| 4228 PrepareCEntryFunction(ext); | 4230 PrepareCEntryFunction(ext); |
| 4229 | 4231 |
| 4230 CEntryStub stub(1); | 4232 CEntryStub stub(isolate(), 1); |
| 4231 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); | 4233 CallStub(&stub, TypeFeedbackId::None(), al, zero_reg, Operand(zero_reg), bd); |
| 4232 } | 4234 } |
| 4233 | 4235 |
| 4234 | 4236 |
| 4235 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, | 4237 void MacroAssembler::TailCallExternalReference(const ExternalReference& ext, |
| 4236 int num_arguments, | 4238 int num_arguments, |
| 4237 int result_size) { | 4239 int result_size) { |
| 4238 // TODO(1236192): Most runtime routines don't need the number of | 4240 // TODO(1236192): Most runtime routines don't need the number of |
| 4239 // arguments passed in because it is constant. At some point we | 4241 // arguments passed in because it is constant. At some point we |
| 4240 // should remove this need and make the runtime routine entry code | 4242 // should remove this need and make the runtime routine entry code |
| 4241 // smarter. | 4243 // smarter. |
| 4242 PrepareCEntryArgs(num_arguments); | 4244 PrepareCEntryArgs(num_arguments); |
| 4243 JumpToExternalReference(ext); | 4245 JumpToExternalReference(ext); |
| 4244 } | 4246 } |
| 4245 | 4247 |
| 4246 | 4248 |
| 4247 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, | 4249 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid, |
| 4248 int num_arguments, | 4250 int num_arguments, |
| 4249 int result_size) { | 4251 int result_size) { |
| 4250 TailCallExternalReference(ExternalReference(fid, isolate()), | 4252 TailCallExternalReference(ExternalReference(fid, isolate()), |
| 4251 num_arguments, | 4253 num_arguments, |
| 4252 result_size); | 4254 result_size); |
| 4253 } | 4255 } |
| 4254 | 4256 |
| 4255 | 4257 |
| 4256 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, | 4258 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin, |
| 4257 BranchDelaySlot bd) { | 4259 BranchDelaySlot bd) { |
| 4258 PrepareCEntryFunction(builtin); | 4260 PrepareCEntryFunction(builtin); |
| 4259 CEntryStub stub(1); | 4261 CEntryStub stub(isolate(), 1); |
| 4260 Jump(stub.GetCode(isolate()), | 4262 Jump(stub.GetCode(isolate()), |
| 4261 RelocInfo::CODE_TARGET, | 4263 RelocInfo::CODE_TARGET, |
| 4262 al, | 4264 al, |
| 4263 zero_reg, | 4265 zero_reg, |
| 4264 Operand(zero_reg), | 4266 Operand(zero_reg), |
| 4265 bd); | 4267 bd); |
| 4266 } | 4268 } |
| 4267 | 4269 |
| 4268 | 4270 |
| 4269 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, | 4271 void MacroAssembler::InvokeBuiltin(Builtins::JavaScript id, |
| (...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5774 } | 5776 } |
| 5775 if (ms.shift() > 0) sra(result, result, ms.shift()); | 5777 if (ms.shift() > 0) sra(result, result, ms.shift()); |
| 5776 srl(at, dividend, 31); | 5778 srl(at, dividend, 31); |
| 5777 Addu(result, result, Operand(at)); | 5779 Addu(result, result, Operand(at)); |
| 5778 } | 5780 } |
| 5779 | 5781 |
| 5780 | 5782 |
| 5781 } } // namespace v8::internal | 5783 } } // namespace v8::internal |
| 5782 | 5784 |
| 5783 #endif // V8_TARGET_ARCH_MIPS | 5785 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |