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 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 !HConstant::cast(string)->HasStringValue()); | 1286 !HConstant::cast(string)->HasStringValue()); |
1287 BuildCheckHeapObject(string); | 1287 BuildCheckHeapObject(string); |
1288 return Add<HCheckInstanceType>(string, HCheckInstanceType::IS_STRING); | 1288 return Add<HCheckInstanceType>(string, HCheckInstanceType::IS_STRING); |
1289 } | 1289 } |
1290 return string; | 1290 return string; |
1291 } | 1291 } |
1292 | 1292 |
1293 | 1293 |
1294 HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* function) { | 1294 HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* function) { |
1295 if (object->type().IsJSObject()) return object; | 1295 if (object->type().IsJSObject()) return object; |
| 1296 // FIXME: need to always wrap Symbol values (but no HType to test against..) |
1296 if (function->IsConstant() && | 1297 if (function->IsConstant() && |
1297 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { | 1298 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { |
1298 Handle<JSFunction> f = Handle<JSFunction>::cast( | 1299 Handle<JSFunction> f = Handle<JSFunction>::cast( |
1299 HConstant::cast(function)->handle(isolate())); | 1300 HConstant::cast(function)->handle(isolate())); |
1300 SharedFunctionInfo* shared = f->shared(); | 1301 SharedFunctionInfo* shared = f->shared(); |
1301 if (!shared->is_classic_mode() || shared->native()) return object; | 1302 if (!shared->is_classic_mode() || shared->native()) return object; |
1302 } | 1303 } |
1303 return Add<HWrapReceiver>(object, function); | 1304 return Add<HWrapReceiver>(object, function); |
1304 } | 1305 } |
1305 | 1306 |
(...skipping 4325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5631 for (int i = 1; i < types->length(); ++i) { | 5632 for (int i = 1; i < types->length(); ++i) { |
5632 PropertyAccessInfo test_info(builder_, IC::MapToType(types->at(i)), name_); | 5633 PropertyAccessInfo test_info(builder_, IC::MapToType(types->at(i)), name_); |
5633 if (!test_info.IsCompatibleForLoad(this)) return false; | 5634 if (!test_info.IsCompatibleForLoad(this)) return false; |
5634 } | 5635 } |
5635 | 5636 |
5636 return true; | 5637 return true; |
5637 } | 5638 } |
5638 | 5639 |
5639 | 5640 |
5640 static bool NeedsWrappingFor(Handle<HeapType> type, Handle<JSFunction> target) { | 5641 static bool NeedsWrappingFor(Handle<HeapType> type, Handle<JSFunction> target) { |
| 5642 if (type->Is(HeapType::Symbol())) return true; |
5641 return type->Is(HeapType::NumberOrString()) && | 5643 return type->Is(HeapType::NumberOrString()) && |
5642 target->shared()->is_classic_mode() && | 5644 target->shared()->is_classic_mode() && |
5643 !target->shared()->native(); | 5645 !target->shared()->native(); |
5644 } | 5646 } |
5645 | 5647 |
5646 | 5648 |
5647 HInstruction* HOptimizedGraphBuilder::BuildLoadMonomorphic( | 5649 HInstruction* HOptimizedGraphBuilder::BuildLoadMonomorphic( |
5648 PropertyAccessInfo* info, | 5650 PropertyAccessInfo* info, |
5649 HValue* object, | 5651 HValue* object, |
5650 HValue* checked_object, | 5652 HValue* checked_object, |
(...skipping 5714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11365 if (ShouldProduceTraceOutput()) { | 11367 if (ShouldProduceTraceOutput()) { |
11366 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11368 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11367 } | 11369 } |
11368 | 11370 |
11369 #ifdef DEBUG | 11371 #ifdef DEBUG |
11370 graph_->Verify(false); // No full verify. | 11372 graph_->Verify(false); // No full verify. |
11371 #endif | 11373 #endif |
11372 } | 11374 } |
11373 | 11375 |
11374 } } // namespace v8::internal | 11376 } } // namespace v8::internal |
OLD | NEW |