OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 10295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10306 void HOptimizedGraphBuilder::GenerateClassOf(CallRuntime* call) { | 10306 void HOptimizedGraphBuilder::GenerateClassOf(CallRuntime* call) { |
10307 // The special form detected by IsClassOfTest is detected before we get here | 10307 // The special form detected by IsClassOfTest is detected before we get here |
10308 // and does not cause a bailout. | 10308 // and does not cause a bailout. |
10309 return Bailout(kInlinedRuntimeFunctionClassOf); | 10309 return Bailout(kInlinedRuntimeFunctionClassOf); |
10310 } | 10310 } |
10311 | 10311 |
10312 | 10312 |
10313 void HOptimizedGraphBuilder::GenerateValueOf(CallRuntime* call) { | 10313 void HOptimizedGraphBuilder::GenerateValueOf(CallRuntime* call) { |
10314 ASSERT(call->arguments()->length() == 1); | 10314 ASSERT(call->arguments()->length() == 1); |
10315 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 10315 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
10316 HValue* value = Pop(); | 10316 HValue* object = Pop(); |
10317 HValueOf* result = New<HValueOf>(value); | 10317 |
10318 return ast_context()->ReturnInstruction(result, call->id()); | 10318 IfBuilder if_objectisvalue(this); |
| 10319 HValue* objectisvalue = if_objectisvalue.If<HHasInstanceTypeAndBranch>( |
| 10320 object, JS_VALUE_TYPE); |
| 10321 if_objectisvalue.Then(); |
| 10322 { |
| 10323 // Return the actual value. |
| 10324 Push(Add<HLoadNamedField>( |
| 10325 object, objectisvalue, |
| 10326 HObjectAccess::ForJSObjectOffset(JSValue::kValueOffset))); |
| 10327 Add<HSimulate>(call->id(), FIXED_SIMULATE); |
| 10328 } |
| 10329 if_objectisvalue.Else(); |
| 10330 { |
| 10331 // If the object is not a value return the object. |
| 10332 Push(object); |
| 10333 Add<HSimulate>(call->id(), FIXED_SIMULATE); |
| 10334 } |
| 10335 if_objectisvalue.End(); |
| 10336 return ast_context()->ReturnValue(Pop()); |
10319 } | 10337 } |
10320 | 10338 |
10321 | 10339 |
10322 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) { | 10340 void HOptimizedGraphBuilder::GenerateDateField(CallRuntime* call) { |
10323 ASSERT(call->arguments()->length() == 2); | 10341 ASSERT(call->arguments()->length() == 2); |
10324 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral()); | 10342 ASSERT_NE(NULL, call->arguments()->at(1)->AsLiteral()); |
10325 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value())); | 10343 Smi* index = Smi::cast(*(call->arguments()->at(1)->AsLiteral()->value())); |
10326 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); | 10344 CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
10327 HValue* date = Pop(); | 10345 HValue* date = Pop(); |
10328 HDateField* result = New<HDateField>(date, index); | 10346 HDateField* result = New<HDateField>(date, index); |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11241 if (ShouldProduceTraceOutput()) { | 11259 if (ShouldProduceTraceOutput()) { |
11242 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11260 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11243 } | 11261 } |
11244 | 11262 |
11245 #ifdef DEBUG | 11263 #ifdef DEBUG |
11246 graph_->Verify(false); // No full verify. | 11264 graph_->Verify(false); // No full verify. |
11247 #endif | 11265 #endif |
11248 } | 11266 } |
11249 | 11267 |
11250 } } // namespace v8::internal | 11268 } } // namespace v8::internal |
OLD | NEW |