| 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 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 } | 1276 } |
| 1277 | 1277 |
| 1278 | 1278 |
| 1279 HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* function) { | 1279 HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* function) { |
| 1280 if (object->type().IsJSObject()) return object; | 1280 if (object->type().IsJSObject()) return object; |
| 1281 if (function->IsConstant() && | 1281 if (function->IsConstant() && |
| 1282 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { | 1282 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { |
| 1283 Handle<JSFunction> f = Handle<JSFunction>::cast( | 1283 Handle<JSFunction> f = Handle<JSFunction>::cast( |
| 1284 HConstant::cast(function)->handle(isolate())); | 1284 HConstant::cast(function)->handle(isolate())); |
| 1285 SharedFunctionInfo* shared = f->shared(); | 1285 SharedFunctionInfo* shared = f->shared(); |
| 1286 if (!shared->is_classic_mode() || shared->native()) return object; | 1286 if (!shared->is_sloppy_mode() || shared->native()) return object; |
| 1287 } | 1287 } |
| 1288 return Add<HWrapReceiver>(object, function); | 1288 return Add<HWrapReceiver>(object, function); |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 | 1291 |
| 1292 HValue* HGraphBuilder::BuildCheckForCapacityGrow( | 1292 HValue* HGraphBuilder::BuildCheckForCapacityGrow( |
| 1293 HValue* object, | 1293 HValue* object, |
| 1294 HValue* elements, | 1294 HValue* elements, |
| 1295 ElementsKind kind, | 1295 ElementsKind kind, |
| 1296 HValue* length, | 1296 HValue* length, |
| (...skipping 4298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5595 builder_, access_type_, ToType(types->at(i)), name_); | 5595 builder_, access_type_, ToType(types->at(i)), name_); |
| 5596 if (!test_info.IsCompatible(this)) return false; | 5596 if (!test_info.IsCompatible(this)) return false; |
| 5597 } | 5597 } |
| 5598 | 5598 |
| 5599 return true; | 5599 return true; |
| 5600 } | 5600 } |
| 5601 | 5601 |
| 5602 | 5602 |
| 5603 static bool NeedsWrappingFor(Type* type, Handle<JSFunction> target) { | 5603 static bool NeedsWrappingFor(Type* type, Handle<JSFunction> target) { |
| 5604 return type->Is(Type::NumberOrString()) && | 5604 return type->Is(Type::NumberOrString()) && |
| 5605 target->shared()->is_classic_mode() && | 5605 target->shared()->is_sloppy_mode() && |
| 5606 !target->shared()->native(); | 5606 !target->shared()->native(); |
| 5607 } | 5607 } |
| 5608 | 5608 |
| 5609 | 5609 |
| 5610 HInstruction* HOptimizedGraphBuilder::BuildMonomorphicAccess( | 5610 HInstruction* HOptimizedGraphBuilder::BuildMonomorphicAccess( |
| 5611 PropertyAccessInfo* info, | 5611 PropertyAccessInfo* info, |
| 5612 HValue* object, | 5612 HValue* object, |
| 5613 HValue* checked_object, | 5613 HValue* checked_object, |
| 5614 HValue* value, | 5614 HValue* value, |
| 5615 BailoutId ast_id, | 5615 BailoutId ast_id, |
| (...skipping 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7942 Drop(1); // Function. | 7942 Drop(1); // Function. |
| 7943 ast_context()->ReturnInstruction(call, expr->id()); | 7943 ast_context()->ReturnInstruction(call, expr->id()); |
| 7944 return true; | 7944 return true; |
| 7945 } | 7945 } |
| 7946 } | 7946 } |
| 7947 | 7947 |
| 7948 | 7948 |
| 7949 HValue* HOptimizedGraphBuilder::ImplicitReceiverFor(HValue* function, | 7949 HValue* HOptimizedGraphBuilder::ImplicitReceiverFor(HValue* function, |
| 7950 Handle<JSFunction> target) { | 7950 Handle<JSFunction> target) { |
| 7951 SharedFunctionInfo* shared = target->shared(); | 7951 SharedFunctionInfo* shared = target->shared(); |
| 7952 if (shared->is_classic_mode() && !shared->native()) { | 7952 if (shared->is_sloppy_mode() && !shared->native()) { |
| 7953 // Cannot embed a direct reference to the global proxy | 7953 // Cannot embed a direct reference to the global proxy |
| 7954 // as is it dropped on deserialization. | 7954 // as is it dropped on deserialization. |
| 7955 CHECK(!Serializer::enabled()); | 7955 CHECK(!Serializer::enabled()); |
| 7956 Handle<JSObject> global_receiver( | 7956 Handle<JSObject> global_receiver( |
| 7957 target->context()->global_object()->global_receiver()); | 7957 target->context()->global_object()->global_receiver()); |
| 7958 return Add<HConstant>(global_receiver); | 7958 return Add<HConstant>(global_receiver); |
| 7959 } | 7959 } |
| 7960 return graph()->GetConstantUndefined(); | 7960 return graph()->GetConstantUndefined(); |
| 7961 } | 7961 } |
| 7962 | 7962 |
| (...skipping 3329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11292 if (ShouldProduceTraceOutput()) { | 11292 if (ShouldProduceTraceOutput()) { |
| 11293 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11293 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11294 } | 11294 } |
| 11295 | 11295 |
| 11296 #ifdef DEBUG | 11296 #ifdef DEBUG |
| 11297 graph_->Verify(false); // No full verify. | 11297 graph_->Verify(false); // No full verify. |
| 11298 #endif | 11298 #endif |
| 11299 } | 11299 } |
| 11300 | 11300 |
| 11301 } } // namespace v8::internal | 11301 } } // namespace v8::internal |
| OLD | NEW |