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

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

Issue 3151002: Refactor and correct IS_SPEC_OBJECT macro (bringing bleeding edge r5087 to 2.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/2.2/
Patch Set: Created 10 years, 4 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/x64/codegen-x64.h ('k') | src/x64/full-codegen-x64.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 5662 matching lines...) Expand 10 before | Expand all | Expand 10 after
5673 __ movzxbq(kScratchRegister, 5673 __ movzxbq(kScratchRegister,
5674 FieldOperand(kScratchRegister, Map::kInstanceTypeOffset)); 5674 FieldOperand(kScratchRegister, Map::kInstanceTypeOffset));
5675 __ cmpq(kScratchRegister, Immediate(FIRST_JS_OBJECT_TYPE)); 5675 __ cmpq(kScratchRegister, Immediate(FIRST_JS_OBJECT_TYPE));
5676 destination()->false_target()->Branch(below); 5676 destination()->false_target()->Branch(below);
5677 __ cmpq(kScratchRegister, Immediate(LAST_JS_OBJECT_TYPE)); 5677 __ cmpq(kScratchRegister, Immediate(LAST_JS_OBJECT_TYPE));
5678 obj.Unuse(); 5678 obj.Unuse();
5679 destination()->Split(below_equal); 5679 destination()->Split(below_equal);
5680 } 5680 }
5681 5681
5682 5682
5683 void CodeGenerator::GenerateIsSpecObject(ZoneList<Expression*>* args) {
5684 // This generates a fast version of:
5685 // (typeof(arg) === 'object' || %_ClassOf(arg) == 'RegExp' ||
5686 // typeof(arg) == function).
5687 // It includes undetectable objects (as opposed to IsObject).
5688 ASSERT(args->length() == 1);
5689 Load(args->at(0));
5690 Result value = frame_->Pop();
5691 value.ToRegister();
5692 ASSERT(value.is_valid());
5693 Condition is_smi = masm_->CheckSmi(value.reg());
5694 destination()->false_target()->Branch(is_smi);
5695 // Check that this is an object.
5696 __ CmpObjectType(value.reg(), FIRST_JS_OBJECT_TYPE, kScratchRegister);
5697 value.Unuse();
5698 destination()->Split(above_equal);
5699 }
5700
5701
5683 void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) { 5702 void CodeGenerator::GenerateIsFunction(ZoneList<Expression*>* args) {
5684 // This generates a fast version of: 5703 // This generates a fast version of:
5685 // (%_ClassOf(arg) === 'Function') 5704 // (%_ClassOf(arg) === 'Function')
5686 ASSERT(args->length() == 1); 5705 ASSERT(args->length() == 1);
5687 Load(args->at(0)); 5706 Load(args->at(0));
5688 Result obj = frame_->Pop(); 5707 Result obj = frame_->Pop();
5689 obj.ToRegister(); 5708 obj.ToRegister();
5690 Condition is_smi = masm_->CheckSmi(obj.reg()); 5709 Condition is_smi = masm_->CheckSmi(obj.reg());
5691 destination()->false_target()->Branch(is_smi); 5710 destination()->false_target()->Branch(is_smi);
5692 __ CmpObjectType(obj.reg(), JS_FUNCTION_TYPE, kScratchRegister); 5711 __ CmpObjectType(obj.reg(), JS_FUNCTION_TYPE, kScratchRegister);
(...skipping 6364 matching lines...) Expand 10 before | Expand all | Expand 10 after
12057 #undef __ 12076 #undef __
12058 12077
12059 void RecordWriteStub::Generate(MacroAssembler* masm) { 12078 void RecordWriteStub::Generate(MacroAssembler* masm) {
12060 masm->RecordWriteHelper(object_, addr_, scratch_); 12079 masm->RecordWriteHelper(object_, addr_, scratch_);
12061 masm->ret(0); 12080 masm->ret(0);
12062 } 12081 }
12063 12082
12064 } } // namespace v8::internal 12083 } } // namespace v8::internal
12065 12084
12066 #endif // V8_TARGET_ARCH_X64 12085 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/codegen-x64.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698