| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 5231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5242 AddInstruction(new(zone()) HCheckFunction(right, target)); | 5242 AddInstruction(new(zone()) HCheckFunction(right, target)); |
| 5243 instr = new(zone()) HInstanceOfKnownGlobal(left, target); | 5243 instr = new(zone()) HInstanceOfKnownGlobal(left, target); |
| 5244 } | 5244 } |
| 5245 } else if (op == Token::IN) { | 5245 } else if (op == Token::IN) { |
| 5246 instr = new(zone()) HIn(left, right); | 5246 instr = new(zone()) HIn(left, right); |
| 5247 } else if (type_info.IsNonPrimitive()) { | 5247 } else if (type_info.IsNonPrimitive()) { |
| 5248 switch (op) { | 5248 switch (op) { |
| 5249 case Token::EQ: | 5249 case Token::EQ: |
| 5250 case Token::EQ_STRICT: { | 5250 case Token::EQ_STRICT: { |
| 5251 AddInstruction(new(zone()) HCheckNonSmi(left)); | 5251 AddInstruction(new(zone()) HCheckNonSmi(left)); |
| 5252 AddInstruction(HCheckInstanceType::NewIsJSObjectOrJSFunction(left)); | 5252 AddInstruction(HCheckInstanceType::NewIsObjectOrFunctionClass(left)); |
| 5253 AddInstruction(new(zone()) HCheckNonSmi(right)); | 5253 AddInstruction(new(zone()) HCheckNonSmi(right)); |
| 5254 AddInstruction(HCheckInstanceType::NewIsJSObjectOrJSFunction(right)); | 5254 AddInstruction(HCheckInstanceType::NewIsObjectOrFunctionClass(right)); |
| 5255 instr = new(zone()) HCompareJSObjectEq(left, right); | 5255 instr = new(zone()) HCompareJSObjectEq(left, right); |
| 5256 break; | 5256 break; |
| 5257 } | 5257 } |
| 5258 default: | 5258 default: |
| 5259 return Bailout("Unsupported non-primitive compare"); | 5259 return Bailout("Unsupported non-primitive compare"); |
| 5260 break; | 5260 break; |
| 5261 } | 5261 } |
| 5262 } else if (type_info.IsString() && oracle()->IsSymbolCompare(expr) && | 5262 } else if (type_info.IsString() && oracle()->IsSymbolCompare(expr) && |
| 5263 (op == Token::EQ || op == Token::EQ_STRICT)) { | 5263 (op == Token::EQ || op == Token::EQ_STRICT)) { |
| 5264 instr = BuildSymbolCompare(left, right, op); | 5264 instr = BuildSymbolCompare(left, right, op); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5318 HIsSmi* result = new(zone()) HIsSmi(value); | 5318 HIsSmi* result = new(zone()) HIsSmi(value); |
| 5319 ast_context()->ReturnInstruction(result, call->id()); | 5319 ast_context()->ReturnInstruction(result, call->id()); |
| 5320 } | 5320 } |
| 5321 | 5321 |
| 5322 | 5322 |
| 5323 void HGraphBuilder::GenerateIsSpecObject(CallRuntime* call) { | 5323 void HGraphBuilder::GenerateIsSpecObject(CallRuntime* call) { |
| 5324 ASSERT(call->arguments()->length() == 1); | 5324 ASSERT(call->arguments()->length() == 1); |
| 5325 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 5325 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 5326 HValue* value = Pop(); | 5326 HValue* value = Pop(); |
| 5327 HHasInstanceType* result = | 5327 HHasInstanceType* result = |
| 5328 new(zone()) HHasInstanceType(value, FIRST_JS_OBJECT_TYPE, LAST_TYPE); | 5328 new(zone()) HHasInstanceType(value, |
| 5329 FIRST_OBJECT_OR_FUNCTION_CLASS_TYPE, |
| 5330 LAST_OBJECT_OR_FUNCTION_CLASS_TYPE); |
| 5329 ast_context()->ReturnInstruction(result, call->id()); | 5331 ast_context()->ReturnInstruction(result, call->id()); |
| 5330 } | 5332 } |
| 5331 | 5333 |
| 5332 | 5334 |
| 5333 void HGraphBuilder::GenerateIsFunction(CallRuntime* call) { | 5335 void HGraphBuilder::GenerateIsFunction(CallRuntime* call) { |
| 5334 ASSERT(call->arguments()->length() == 1); | 5336 ASSERT(call->arguments()->length() == 1); |
| 5335 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 5337 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
| 5336 HValue* value = Pop(); | 5338 HValue* value = Pop(); |
| 5337 HHasInstanceType* result = | 5339 HHasInstanceType* result = |
| 5338 new(zone()) HHasInstanceType(value, JS_FUNCTION_TYPE); | 5340 new(zone()) HHasInstanceType(value, JS_FUNCTION_TYPE); |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6214 } | 6216 } |
| 6215 } | 6217 } |
| 6216 | 6218 |
| 6217 #ifdef DEBUG | 6219 #ifdef DEBUG |
| 6218 if (graph_ != NULL) graph_->Verify(); | 6220 if (graph_ != NULL) graph_->Verify(); |
| 6219 if (allocator_ != NULL) allocator_->Verify(); | 6221 if (allocator_ != NULL) allocator_->Verify(); |
| 6220 #endif | 6222 #endif |
| 6221 } | 6223 } |
| 6222 | 6224 |
| 6223 } } // namespace v8::internal | 6225 } } // namespace v8::internal |
| OLD | NEW |