| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast/ast-numbering.h" | 10 #include "src/ast/ast-numbering.h" |
| (...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 HValue* HGraphBuilder::BuildCheckString(HValue* string) { | 1295 HValue* HGraphBuilder::BuildCheckString(HValue* string) { |
| 1296 if (!string->type().IsString()) { | 1296 if (!string->type().IsString()) { |
| 1297 DCHECK(!string->IsConstant() || | 1297 DCHECK(!string->IsConstant() || |
| 1298 !HConstant::cast(string)->HasStringValue()); | 1298 !HConstant::cast(string)->HasStringValue()); |
| 1299 BuildCheckHeapObject(string); | 1299 BuildCheckHeapObject(string); |
| 1300 return Add<HCheckInstanceType>(string, HCheckInstanceType::IS_STRING); | 1300 return Add<HCheckInstanceType>(string, HCheckInstanceType::IS_STRING); |
| 1301 } | 1301 } |
| 1302 return string; | 1302 return string; |
| 1303 } | 1303 } |
| 1304 | 1304 |
| 1305 | 1305 HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* checked) { |
| 1306 HValue* HGraphBuilder::BuildWrapReceiver(HValue* object, HValue* function) { | |
| 1307 if (object->type().IsJSObject()) return object; | 1306 if (object->type().IsJSObject()) return object; |
| 1307 HValue* function = checked->ActualValue(); |
| 1308 if (function->IsConstant() && | 1308 if (function->IsConstant() && |
| 1309 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { | 1309 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { |
| 1310 Handle<JSFunction> f = Handle<JSFunction>::cast( | 1310 Handle<JSFunction> f = Handle<JSFunction>::cast( |
| 1311 HConstant::cast(function)->handle(isolate())); | 1311 HConstant::cast(function)->handle(isolate())); |
| 1312 SharedFunctionInfo* shared = f->shared(); | 1312 SharedFunctionInfo* shared = f->shared(); |
| 1313 if (is_strict(shared->language_mode()) || shared->native()) return object; | 1313 if (is_strict(shared->language_mode()) || shared->native()) return object; |
| 1314 } | 1314 } |
| 1315 return Add<HWrapReceiver>(object, function); | 1315 return Add<HWrapReceiver>(object, checked); |
| 1316 } | 1316 } |
| 1317 | 1317 |
| 1318 | 1318 |
| 1319 HValue* HGraphBuilder::BuildCheckAndGrowElementsCapacity( | 1319 HValue* HGraphBuilder::BuildCheckAndGrowElementsCapacity( |
| 1320 HValue* object, HValue* elements, ElementsKind kind, HValue* length, | 1320 HValue* object, HValue* elements, ElementsKind kind, HValue* length, |
| 1321 HValue* capacity, HValue* key) { | 1321 HValue* capacity, HValue* key) { |
| 1322 HValue* max_gap = Add<HConstant>(static_cast<int32_t>(JSObject::kMaxGap)); | 1322 HValue* max_gap = Add<HConstant>(static_cast<int32_t>(JSObject::kMaxGap)); |
| 1323 HValue* max_capacity = AddUncasted<HAdd>(capacity, max_gap); | 1323 HValue* max_capacity = AddUncasted<HAdd>(capacity, max_gap); |
| 1324 Add<HBoundsCheck>(key, max_capacity); | 1324 Add<HBoundsCheck>(key, max_capacity); |
| 1325 | 1325 |
| (...skipping 12127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13453 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13453 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13454 } | 13454 } |
| 13455 | 13455 |
| 13456 #ifdef DEBUG | 13456 #ifdef DEBUG |
| 13457 graph_->Verify(false); // No full verify. | 13457 graph_->Verify(false); // No full verify. |
| 13458 #endif | 13458 #endif |
| 13459 } | 13459 } |
| 13460 | 13460 |
| 13461 } // namespace internal | 13461 } // namespace internal |
| 13462 } // namespace v8 | 13462 } // namespace v8 |
| OLD | NEW |