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

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

Issue 151018: Optimize %ClassOf() on IA-32 and use it instead of the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 5 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/arm/codegen-arm.h ('k') | src/codegen.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 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3173 &num_args, 3173 &num_args,
3174 &function, 3174 &function,
3175 arg_count + 1); 3175 arg_count + 1);
3176 3176
3177 // Discard old TOS value and push r0 on the stack (same as Pop(), push(r0)). 3177 // Discard old TOS value and push r0 on the stack (same as Pop(), push(r0)).
3178 __ str(r0, frame_->Top()); 3178 __ str(r0, frame_->Top());
3179 ASSERT(frame_->height() == original_height + 1); 3179 ASSERT(frame_->height() == original_height + 1);
3180 } 3180 }
3181 3181
3182 3182
3183 void CodeGenerator::GenerateClassOf(ZoneList<Expression*>* args) {
3184 VirtualFrame::SpilledScope spilled_scope;
3185 ASSERT(args->length() == 1);
3186 LoadAndSpill(args->at(0)); // Load the object.
3187 frame_->CallRuntime(Runtime::kClassOf, 1);
3188 frame_->EmitPush(r0);
3189 }
3190
3191
3183 void CodeGenerator::GenerateValueOf(ZoneList<Expression*>* args) { 3192 void CodeGenerator::GenerateValueOf(ZoneList<Expression*>* args) {
3184 VirtualFrame::SpilledScope spilled_scope; 3193 VirtualFrame::SpilledScope spilled_scope;
3185 ASSERT(args->length() == 1); 3194 ASSERT(args->length() == 1);
3186 JumpTarget leave; 3195 JumpTarget leave;
3187 LoadAndSpill(args->at(0)); 3196 LoadAndSpill(args->at(0));
3188 frame_->EmitPop(r0); // r0 contains object. 3197 frame_->EmitPop(r0); // r0 contains object.
3189 // if (object->IsSmi()) return the object. 3198 // if (object->IsSmi()) return the object.
3190 __ tst(r0, Operand(kSmiTagMask)); 3199 __ tst(r0, Operand(kSmiTagMask));
3191 leave.Branch(eq); 3200 leave.Branch(eq);
3192 // It is a heap object - get map. If (!object->IsJSValue()) return the object. 3201 // It is a heap object - get map. If (!object->IsJSValue()) return the object.
(...skipping 2440 matching lines...) Expand 10 before | Expand all | Expand 10 after
5633 __ mov(r2, Operand(0)); 5642 __ mov(r2, Operand(0));
5634 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION); 5643 __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION);
5635 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)), 5644 __ Jump(Handle<Code>(Builtins::builtin(Builtins::ArgumentsAdaptorTrampoline)),
5636 RelocInfo::CODE_TARGET); 5645 RelocInfo::CODE_TARGET);
5637 } 5646 }
5638 5647
5639 5648
5640 #undef __ 5649 #undef __
5641 5650
5642 } } // namespace v8::internal 5651 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/codegen-arm.h ('k') | src/codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698