Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/crankshaft/hydrogen.cc

Issue 1747753003: [crankshaft] Check checked_function->ActualValue() in BuildWrapReceiver (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Pass in checked to HWrapReceiver ... Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698