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 5165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5176 destination()->false_target()->Branch(zero); | 5176 destination()->false_target()->Branch(zero); |
5177 Result temp = allocator()->Allocate(); | 5177 Result temp = allocator()->Allocate(); |
5178 ASSERT(temp.is_valid()); | 5178 ASSERT(temp.is_valid()); |
5179 __ CmpObjectType(obj.reg(), JS_FUNCTION_TYPE, temp.reg()); | 5179 __ CmpObjectType(obj.reg(), JS_FUNCTION_TYPE, temp.reg()); |
5180 obj.Unuse(); | 5180 obj.Unuse(); |
5181 temp.Unuse(); | 5181 temp.Unuse(); |
5182 destination()->Split(equal); | 5182 destination()->Split(equal); |
5183 } | 5183 } |
5184 | 5184 |
5185 | 5185 |
| 5186 void CodeGenerator::GenerateIsUndetectableObject(ZoneList<Expression*>* args) { |
| 5187 ASSERT(args->length() == 1); |
| 5188 Load(args->at(0)); |
| 5189 Result obj = frame_->Pop(); |
| 5190 obj.ToRegister(); |
| 5191 __ test(obj.reg(), Immediate(kSmiTagMask)); |
| 5192 destination()->false_target()->Branch(zero); |
| 5193 Result temp = allocator()->Allocate(); |
| 5194 ASSERT(temp.is_valid()); |
| 5195 __ mov(temp.reg(), |
| 5196 FieldOperand(obj.reg(), HeapObject::kMapOffset)); |
| 5197 __ movzx_b(temp.reg(), |
| 5198 FieldOperand(temp.reg(), Map::kBitFieldOffset)); |
| 5199 __ test(temp.reg(), Immediate(1 << Map::kIsUndetectable)); |
| 5200 obj.Unuse(); |
| 5201 temp.Unuse(); |
| 5202 destination()->Split(not_zero); |
| 5203 } |
| 5204 |
| 5205 |
5186 void CodeGenerator::GenerateIsConstructCall(ZoneList<Expression*>* args) { | 5206 void CodeGenerator::GenerateIsConstructCall(ZoneList<Expression*>* args) { |
5187 ASSERT(args->length() == 0); | 5207 ASSERT(args->length() == 0); |
5188 | 5208 |
5189 // Get the frame pointer for the calling frame. | 5209 // Get the frame pointer for the calling frame. |
5190 Result fp = allocator()->Allocate(); | 5210 Result fp = allocator()->Allocate(); |
5191 __ mov(fp.reg(), Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 5211 __ mov(fp.reg(), Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
5192 | 5212 |
5193 // Skip the arguments adaptor frame if it exists. | 5213 // Skip the arguments adaptor frame if it exists. |
5194 Label check_frame_marker; | 5214 Label check_frame_marker; |
5195 __ cmp(Operand(fp.reg(), StandardFrameConstants::kContextOffset), | 5215 __ cmp(Operand(fp.reg(), StandardFrameConstants::kContextOffset), |
(...skipping 4593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9789 | 9809 |
9790 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 9810 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
9791 // tagged as a small integer. | 9811 // tagged as a small integer. |
9792 __ bind(&runtime); | 9812 __ bind(&runtime); |
9793 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); | 9813 __ TailCallRuntime(ExternalReference(Runtime::kStringCompare), 2, 1); |
9794 } | 9814 } |
9795 | 9815 |
9796 #undef __ | 9816 #undef __ |
9797 | 9817 |
9798 } } // namespace v8::internal | 9818 } } // namespace v8::internal |
OLD | NEW |