| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2712 Load(args->at(0)); | 2712 Load(args->at(0)); |
| 2713 frame_->Pop(r0); | 2713 frame_->Pop(r0); |
| 2714 __ tst(r0, Operand(kSmiTagMask)); | 2714 __ tst(r0, Operand(kSmiTagMask)); |
| 2715 cc_reg_ = eq; | 2715 cc_reg_ = eq; |
| 2716 } | 2716 } |
| 2717 | 2717 |
| 2718 | 2718 |
| 2719 void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) { | 2719 void CodeGenerator::GenerateLog(ZoneList<Expression*>* args) { |
| 2720 // See comment in CodeGenerator::GenerateLog in codegen-ia32.cc. | 2720 // See comment in CodeGenerator::GenerateLog in codegen-ia32.cc. |
| 2721 ASSERT_EQ(args->length(), 3); | 2721 ASSERT_EQ(args->length(), 3); |
| 2722 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 2722 if (ShouldGenerateLog(args->at(0))) { | 2723 if (ShouldGenerateLog(args->at(0))) { |
| 2723 Load(args->at(1)); | 2724 Load(args->at(1)); |
| 2724 Load(args->at(2)); | 2725 Load(args->at(2)); |
| 2725 __ CallRuntime(Runtime::kLog, 2); | 2726 __ CallRuntime(Runtime::kLog, 2); |
| 2726 } | 2727 } |
| 2728 #endif |
| 2727 __ mov(r0, Operand(Factory::undefined_value())); | 2729 __ mov(r0, Operand(Factory::undefined_value())); |
| 2728 frame_->Push(r0); | 2730 frame_->Push(r0); |
| 2729 } | 2731 } |
| 2730 | 2732 |
| 2731 | 2733 |
| 2732 void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) { | 2734 void CodeGenerator::GenerateIsNonNegativeSmi(ZoneList<Expression*>* args) { |
| 2733 ASSERT(args->length() == 1); | 2735 ASSERT(args->length() == 1); |
| 2734 Load(args->at(0)); | 2736 Load(args->at(0)); |
| 2735 frame_->Pop(r0); | 2737 frame_->Pop(r0); |
| 2736 __ tst(r0, Operand(kSmiTagMask | 0x80000000)); | 2738 __ tst(r0, Operand(kSmiTagMask | 0x80000000)); |
| (...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4182 ASSERT(Failure::RETRY_AFTER_GC == 0); | 4184 ASSERT(Failure::RETRY_AFTER_GC == 0); |
| 4183 __ tst(r0, Operand(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); | 4185 __ tst(r0, Operand(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); |
| 4184 __ b(eq, &retry); | 4186 __ b(eq, &retry); |
| 4185 | 4187 |
| 4186 Label continue_exception; | 4188 Label continue_exception; |
| 4187 // If the returned failure is EXCEPTION then promote Top::pending_exception(). | 4189 // If the returned failure is EXCEPTION then promote Top::pending_exception(). |
| 4188 __ cmp(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); | 4190 __ cmp(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
| 4189 __ b(ne, &continue_exception); | 4191 __ b(ne, &continue_exception); |
| 4190 | 4192 |
| 4191 // Retrieve the pending exception and clear the variable. | 4193 // Retrieve the pending exception and clear the variable. |
| 4192 __ mov(ip, Operand(Factory::the_hole_value().location())); | 4194 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
| 4193 __ ldr(r3, MemOperand(ip)); | 4195 __ ldr(r3, MemOperand(ip)); |
| 4194 __ mov(ip, Operand(Top::pending_exception_address())); | 4196 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); |
| 4195 __ ldr(r0, MemOperand(ip)); | 4197 __ ldr(r0, MemOperand(ip)); |
| 4196 __ str(r3, MemOperand(ip)); | 4198 __ str(r3, MemOperand(ip)); |
| 4197 | 4199 |
| 4198 __ bind(&continue_exception); | 4200 __ bind(&continue_exception); |
| 4199 // Special handling of out of memory exception. | 4201 // Special handling of out of memory exception. |
| 4200 Failure* out_of_memory = Failure::OutOfMemoryException(); | 4202 Failure* out_of_memory = Failure::OutOfMemoryException(); |
| 4201 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); | 4203 __ cmp(r0, Operand(reinterpret_cast<int32_t>(out_of_memory))); |
| 4202 __ b(eq, throw_out_of_memory_exception); | 4204 __ b(eq, throw_out_of_memory_exception); |
| 4203 | 4205 |
| 4204 // Handle normal exception. | 4206 // Handle normal exception. |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4314 // Setup frame pointer for the frame to be pushed. | 4316 // Setup frame pointer for the frame to be pushed. |
| 4315 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); | 4317 __ add(fp, sp, Operand(-EntryFrameConstants::kCallerFPOffset)); |
| 4316 | 4318 |
| 4317 // Call a faked try-block that does the invoke. | 4319 // Call a faked try-block that does the invoke. |
| 4318 __ bl(&invoke); | 4320 __ bl(&invoke); |
| 4319 | 4321 |
| 4320 // Caught exception: Store result (exception) in the pending | 4322 // Caught exception: Store result (exception) in the pending |
| 4321 // exception field in the JSEnv and return a failure sentinel. | 4323 // exception field in the JSEnv and return a failure sentinel. |
| 4322 // Coming in here the fp will be invalid because the PushTryHandler below | 4324 // Coming in here the fp will be invalid because the PushTryHandler below |
| 4323 // sets it to 0 to signal the existence of the JSEntry frame. | 4325 // sets it to 0 to signal the existence of the JSEntry frame. |
| 4324 __ mov(ip, Operand(Top::pending_exception_address())); | 4326 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); |
| 4325 __ str(r0, MemOperand(ip)); | 4327 __ str(r0, MemOperand(ip)); |
| 4326 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); | 4328 __ mov(r0, Operand(reinterpret_cast<int32_t>(Failure::Exception()))); |
| 4327 __ b(&exit); | 4329 __ b(&exit); |
| 4328 | 4330 |
| 4329 // Invoke: Link this frame into the handler chain. | 4331 // Invoke: Link this frame into the handler chain. |
| 4330 __ bind(&invoke); | 4332 __ bind(&invoke); |
| 4331 // Must preserve r0-r4, r5-r7 are available. | 4333 // Must preserve r0-r4, r5-r7 are available. |
| 4332 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); | 4334 __ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER); |
| 4333 // If an exception not caught by another handler occurs, this handler returns | 4335 // If an exception not caught by another handler occurs, this handler returns |
| 4334 // control to the code after the bl(&invoke) above, which restores all | 4336 // control to the code after the bl(&invoke) above, which restores all |
| 4335 // kCalleeSaved registers (including cp, pp and fp) to their saved values | 4337 // kCalleeSaved registers (including cp, pp and fp) to their saved values |
| 4336 // before returning a failure to C. | 4338 // before returning a failure to C. |
| 4337 | 4339 |
| 4338 // Clear any pending exceptions. | 4340 // Clear any pending exceptions. |
| 4339 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); | 4341 __ mov(ip, Operand(ExternalReference::the_hole_value_location())); |
| 4340 __ ldr(r5, MemOperand(ip)); | 4342 __ ldr(r5, MemOperand(ip)); |
| 4341 __ mov(ip, Operand(Top::pending_exception_address())); | 4343 __ mov(ip, Operand(ExternalReference(Top::k_pending_exception_address))); |
| 4342 __ str(r5, MemOperand(ip)); | 4344 __ str(r5, MemOperand(ip)); |
| 4343 | 4345 |
| 4344 // Invoke the function by calling through JS entry trampoline builtin. | 4346 // Invoke the function by calling through JS entry trampoline builtin. |
| 4345 // Notice that we cannot store a reference to the trampoline code directly in | 4347 // Notice that we cannot store a reference to the trampoline code directly in |
| 4346 // this stub, because runtime stubs are not traversed when doing GC. | 4348 // this stub, because runtime stubs are not traversed when doing GC. |
| 4347 | 4349 |
| 4348 // Expected registers by Builtins::JSEntryTrampoline | 4350 // Expected registers by Builtins::JSEntryTrampoline |
| 4349 // r0: code entry | 4351 // r0: code entry |
| 4350 // r1: function | 4352 // r1: function |
| 4351 // r2: receiver | 4353 // r2: receiver |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4511 __ mov(r2, Operand(0)); | 4513 __ mov(r2, Operand(0)); |
| 4512 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); | 4514 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); |
| 4513 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), | 4515 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), |
| 4514 RelocInfo::CODE_TARGET); | 4516 RelocInfo::CODE_TARGET); |
| 4515 } | 4517 } |
| 4516 | 4518 |
| 4517 | 4519 |
| 4518 #undef __ | 4520 #undef __ |
| 4519 | 4521 |
| 4520 } } // namespace v8::internal | 4522 } } // namespace v8::internal |
| OLD | NEW |