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

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

Issue 126113: Change the implementation of Math.random to use George... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 6 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/ia32/codegen-ia32.h ('k') | src/math.js » ('j') | src/v8.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/math.js » ('j') | src/v8.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698