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

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

Issue 399044: Merge r3285, r3313, and r3318 to branches/1.3. (Closed) Base URL: http://v8.googlecode.com/svn/branches/1.3/
Patch Set: Created 11 years, 1 month 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/ia32/register-allocator-ia32.cc » ('j') | no next file with comments »
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 3940 matching lines...) Expand 10 before | Expand all | Expand 10 after
3951 } 3951 }
3952 } 3952 }
3953 3953
3954 3954
3955 void CodeGenerator::VisitLiteral(Literal* node) { 3955 void CodeGenerator::VisitLiteral(Literal* node) {
3956 Comment cmnt(masm_, "[ Literal"); 3956 Comment cmnt(masm_, "[ Literal");
3957 frame_->Push(node->handle()); 3957 frame_->Push(node->handle());
3958 } 3958 }
3959 3959
3960 3960
3961 void CodeGenerator::LoadUnsafeSmi(Register target, Handle<Object> value) { 3961 void CodeGenerator::PushUnsafeSmi(Handle<Object> value) {
3962 ASSERT(value->IsSmi());
3963 int bits = reinterpret_cast<int>(*value);
3964 __ push(Immediate(bits & 0x0000FFFF));
3965 __ or_(Operand(esp, 0), Immediate(bits & 0xFFFF0000));
3966 }
3967
3968
3969 void CodeGenerator::StoreUnsafeSmiToLocal(int offset, Handle<Object> value) {
3970 ASSERT(value->IsSmi());
3971 int bits = reinterpret_cast<int>(*value);
3972 __ mov(Operand(ebp, offset), Immediate(bits & 0x0000FFFF));
3973 __ or_(Operand(ebp, offset), Immediate(bits & 0xFFFF0000));
3974 }
3975
3976
3977 void CodeGenerator::MoveUnsafeSmi(Register target, Handle<Object> value) {
3962 ASSERT(target.is_valid()); 3978 ASSERT(target.is_valid());
3963 ASSERT(value->IsSmi()); 3979 ASSERT(value->IsSmi());
3964 int bits = reinterpret_cast<int>(*value); 3980 int bits = reinterpret_cast<int>(*value);
3965 __ Set(target, Immediate(bits & 0x0000FFFF)); 3981 __ Set(target, Immediate(bits & 0x0000FFFF));
3966 __ xor_(target, bits & 0xFFFF0000); 3982 __ or_(target, bits & 0xFFFF0000);
3967 } 3983 }
3968 3984
3969 3985
3970 bool CodeGenerator::IsUnsafeSmi(Handle<Object> value) { 3986 bool CodeGenerator::IsUnsafeSmi(Handle<Object> value) {
3971 if (!value->IsSmi()) return false; 3987 if (!value->IsSmi()) return false;
3972 int int_value = Smi::cast(*value)->value(); 3988 int int_value = Smi::cast(*value)->value();
3973 return !is_intn(int_value, kMaxSmiInlinedBits); 3989 return !is_intn(int_value, kMaxSmiInlinedBits);
3974 } 3990 }
3975 3991
3976 3992
(...skipping 4099 matching lines...) Expand 10 before | Expand all | Expand 10 after
8076 8092
8077 int CompareStub::MinorKey() { 8093 int CompareStub::MinorKey() {
8078 // Encode the two parameters in a unique 16 bit value. 8094 // Encode the two parameters in a unique 16 bit value.
8079 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); 8095 ASSERT(static_cast<unsigned>(cc_) < (1 << 15));
8080 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); 8096 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0);
8081 } 8097 }
8082 8098
8083 #undef __ 8099 #undef __
8084 8100
8085 } } // namespace v8::internal 8101 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/ia32/register-allocator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698