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

Side by Side Diff: src/compiler/js-native-context-specialization.cc

Issue 2856103002: [turbofan] Introduce dedicated CallFrequency class. (Closed)
Patch Set: Address offline feedback from jarin@. Created 3 years, 7 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 | « src/compiler/js-intrinsic-lowering.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/compiler/js-native-context-specialization.h" 5 #include "src/compiler/js-native-context-specialization.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/compilation-dependencies.h" 9 #include "src/compilation-dependencies.h"
10 #include "src/compiler/access-builder.h" 10 #include "src/compiler/access-builder.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 effect = BuildCheckMaps(constructor, effect, control, 235 effect = BuildCheckMaps(constructor, effect, control,
236 access_info.receiver_maps()); 236 access_info.receiver_maps());
237 237
238 // Call the @@hasInstance handler. 238 // Call the @@hasInstance handler.
239 Node* target = jsgraph()->Constant(constant); 239 Node* target = jsgraph()->Constant(constant);
240 node->InsertInput(graph()->zone(), 0, target); 240 node->InsertInput(graph()->zone(), 0, target);
241 node->ReplaceInput(1, constructor); 241 node->ReplaceInput(1, constructor);
242 node->ReplaceInput(2, object); 242 node->ReplaceInput(2, object);
243 node->ReplaceInput(5, effect); 243 node->ReplaceInput(5, effect);
244 NodeProperties::ChangeOp( 244 NodeProperties::ChangeOp(
245 node, 245 node, javascript()->Call(3, CallFrequency(), VectorSlotPair(),
246 javascript()->Call(3, 0.0f, VectorSlotPair(), 246 ConvertReceiverMode::kNotNullOrUndefined));
247 ConvertReceiverMode::kNotNullOrUndefined));
248 247
249 // Rewire the value uses of {node} to ToBoolean conversion of the result. 248 // Rewire the value uses of {node} to ToBoolean conversion of the result.
250 Node* value = graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny), 249 Node* value = graph()->NewNode(javascript()->ToBoolean(ToBooleanHint::kAny),
251 node, context); 250 node, context);
252 for (Edge edge : node->use_edges()) { 251 for (Edge edge : node->use_edges()) {
253 if (NodeProperties::IsValueEdge(edge) && edge.from() != value) { 252 if (NodeProperties::IsValueEdge(edge) && edge.from() != value) {
254 edge.UpdateTo(value); 253 edge.UpdateTo(value);
255 Revisit(edge.from()); 254 Revisit(edge.from());
256 } 255 }
257 } 256 }
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 OutputFrameStateCombine::Ignore(), 1495 OutputFrameStateCombine::Ignore(),
1497 frame_info0), 1496 frame_info0),
1498 graph()->NewNode(common()->StateValues(1, SparseInputMask::Dense()), 1497 graph()->NewNode(common()->StateValues(1, SparseInputMask::Dense()),
1499 receiver), 1498 receiver),
1500 jsgraph()->EmptyStateValues(), jsgraph()->EmptyStateValues(), 1499 jsgraph()->EmptyStateValues(), jsgraph()->EmptyStateValues(),
1501 context, target, frame_state); 1500 context, target, frame_state);
1502 1501
1503 // Introduce the call to the getter function. 1502 // Introduce the call to the getter function.
1504 if (access_info.constant()->IsJSFunction()) { 1503 if (access_info.constant()->IsJSFunction()) {
1505 value = effect = control = graph()->NewNode( 1504 value = effect = control = graph()->NewNode(
1506 javascript()->Call(2, 0.0f, VectorSlotPair(), 1505 javascript()->Call(2, CallFrequency(), VectorSlotPair(),
1507 ConvertReceiverMode::kNotNullOrUndefined), 1506 ConvertReceiverMode::kNotNullOrUndefined),
1508 target, receiver, context, frame_state0, effect, control); 1507 target, receiver, context, frame_state0, effect, control);
1509 } else { 1508 } else {
1510 DCHECK(access_info.constant()->IsFunctionTemplateInfo()); 1509 DCHECK(access_info.constant()->IsFunctionTemplateInfo());
1511 Handle<FunctionTemplateInfo> function_template_info( 1510 Handle<FunctionTemplateInfo> function_template_info(
1512 Handle<FunctionTemplateInfo>::cast(access_info.constant())); 1511 Handle<FunctionTemplateInfo>::cast(access_info.constant()));
1513 DCHECK(!function_template_info->call_code()->IsUndefined(isolate())); 1512 DCHECK(!function_template_info->call_code()->IsUndefined(isolate()));
1514 ValueEffectControl value_effect_control = InlineApiCall( 1513 ValueEffectControl value_effect_control = InlineApiCall(
1515 receiver, context, target, frame_state0, nullptr, effect, control, 1514 receiver, context, target, frame_state0, nullptr, effect, control,
1516 shared_info, function_template_info); 1515 shared_info, function_template_info);
(...skipping 15 matching lines...) Expand all
1532 OutputFrameStateCombine::Ignore(), 1531 OutputFrameStateCombine::Ignore(),
1533 frame_info0), 1532 frame_info0),
1534 graph()->NewNode(common()->StateValues(2, SparseInputMask::Dense()), 1533 graph()->NewNode(common()->StateValues(2, SparseInputMask::Dense()),
1535 receiver, value), 1534 receiver, value),
1536 jsgraph()->EmptyStateValues(), jsgraph()->EmptyStateValues(), 1535 jsgraph()->EmptyStateValues(), jsgraph()->EmptyStateValues(),
1537 context, target, frame_state); 1536 context, target, frame_state);
1538 1537
1539 // Introduce the call to the setter function. 1538 // Introduce the call to the setter function.
1540 if (access_info.constant()->IsJSFunction()) { 1539 if (access_info.constant()->IsJSFunction()) {
1541 effect = control = graph()->NewNode( 1540 effect = control = graph()->NewNode(
1542 javascript()->Call(3, 0.0f, VectorSlotPair(), 1541 javascript()->Call(3, CallFrequency(), VectorSlotPair(),
1543 ConvertReceiverMode::kNotNullOrUndefined), 1542 ConvertReceiverMode::kNotNullOrUndefined),
1544 target, receiver, value, context, frame_state0, effect, control); 1543 target, receiver, value, context, frame_state0, effect, control);
1545 } else { 1544 } else {
1546 DCHECK(access_info.constant()->IsFunctionTemplateInfo()); 1545 DCHECK(access_info.constant()->IsFunctionTemplateInfo());
1547 Handle<FunctionTemplateInfo> function_template_info( 1546 Handle<FunctionTemplateInfo> function_template_info(
1548 Handle<FunctionTemplateInfo>::cast(access_info.constant())); 1547 Handle<FunctionTemplateInfo>::cast(access_info.constant()));
1549 DCHECK(!function_template_info->call_code()->IsUndefined(isolate())); 1548 DCHECK(!function_template_info->call_code()->IsUndefined(isolate()));
1550 ValueEffectControl value_effect_control = InlineApiCall( 1549 ValueEffectControl value_effect_control = InlineApiCall(
1551 receiver, context, target, frame_state0, value, effect, control, 1550 receiver, context, target, frame_state0, value, effect, control,
1552 shared_info, function_template_info); 1551 shared_info, function_template_info);
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 return jsgraph()->javascript(); 2570 return jsgraph()->javascript();
2572 } 2571 }
2573 2572
2574 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { 2573 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const {
2575 return jsgraph()->simplified(); 2574 return jsgraph()->simplified();
2576 } 2575 }
2577 2576
2578 } // namespace compiler 2577 } // namespace compiler
2579 } // namespace internal 2578 } // namespace internal
2580 } // namespace v8 2579 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-intrinsic-lowering.cc ('k') | src/compiler/js-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698