OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 4895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4906 ASSERT(args->length() == 0); | 4906 ASSERT(args->length() == 0); |
4907 ASSERT(kSmiTagSize == 1 && kSmiTag == 0); // shifting code depends on this | 4907 ASSERT(kSmiTagSize == 1 && kSmiTag == 0); // shifting code depends on this |
4908 Result ebp_as_smi = allocator_->Allocate(); | 4908 Result ebp_as_smi = allocator_->Allocate(); |
4909 ASSERT(ebp_as_smi.is_valid()); | 4909 ASSERT(ebp_as_smi.is_valid()); |
4910 __ mov(ebp_as_smi.reg(), Operand(ebp)); | 4910 __ mov(ebp_as_smi.reg(), Operand(ebp)); |
4911 __ shr(ebp_as_smi.reg(), kSmiTagSize); | 4911 __ shr(ebp_as_smi.reg(), kSmiTagSize); |
4912 frame_->Push(&ebp_as_smi); | 4912 frame_->Push(&ebp_as_smi); |
4913 } | 4913 } |
4914 | 4914 |
4915 | 4915 |
| 4916 void CodeGenerator::GenerateRandomPositiveSmi(ZoneList<Expression*>* args) { |
| 4917 ASSERT(args->length() == 0); |
| 4918 frame_->SpillAll(); |
| 4919 __ call(FUNCTION_ADDR(V8::RandomPositiveSmi), RelocInfo::RUNTIME_ENTRY); |
| 4920 Result result = allocator_->Allocate(eax); |
| 4921 frame_->Push(&result); |
| 4922 } |
| 4923 |
| 4924 |
4916 void CodeGenerator::VisitCallRuntime(CallRuntime* node) { | 4925 void CodeGenerator::VisitCallRuntime(CallRuntime* node) { |
4917 if (CheckForInlineRuntimeCall(node)) { | 4926 if (CheckForInlineRuntimeCall(node)) { |
4918 return; | 4927 return; |
4919 } | 4928 } |
4920 | 4929 |
4921 ZoneList<Expression*>* args = node->arguments(); | 4930 ZoneList<Expression*>* args = node->arguments(); |
4922 Comment cmnt(masm_, "[ CallRuntime"); | 4931 Comment cmnt(masm_, "[ CallRuntime"); |
4923 Runtime::Function* function = node->function(); | 4932 Runtime::Function* function = node->function(); |
4924 | 4933 |
4925 if (function == NULL) { | 4934 if (function == NULL) { |
(...skipping 2545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7471 | 7480 |
7472 // Slow-case: Go through the JavaScript implementation. | 7481 // Slow-case: Go through the JavaScript implementation. |
7473 __ bind(&slow); | 7482 __ bind(&slow); |
7474 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); | 7483 __ InvokeBuiltin(Builtins::INSTANCE_OF, JUMP_FUNCTION); |
7475 } | 7484 } |
7476 | 7485 |
7477 | 7486 |
7478 #undef __ | 7487 #undef __ |
7479 | 7488 |
7480 } } // namespace v8::internal | 7489 } } // namespace v8::internal |
OLD | NEW |