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

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

Issue 1427913003: [turbofan] Add support for loading missing properties. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-native-context-specialization.h ('k') | src/compiler/property-access-info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index bc86bcbdd71d53ef28ab3cf796da71bc0ae12435..550295348864d1353fbbce7e616ce12796505c28 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -303,7 +303,8 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreGlobal(Node* node) {
Reduction JSNativeContextSpecialization::ReduceNamedAccess(
Node* node, Node* value, MapHandleList const& receiver_maps,
- Handle<Name> name, PropertyAccessMode access_mode) {
+ Handle<Name> name, PropertyAccessMode access_mode,
+ LanguageMode language_mode) {
DCHECK(node->opcode() == IrOpcode::kJSLoadNamed ||
node->opcode() == IrOpcode::kJSStoreNamed);
Node* receiver = NodeProperties::GetValueInput(node, 0);
@@ -399,7 +400,17 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
}
// Generate the actual property access.
- if (access_info.IsDataConstant()) {
+ if (access_info.IsNotFound()) {
+ DCHECK_EQ(PropertyAccessMode::kLoad, access_mode);
+ if (is_strong(language_mode)) {
+ // TODO(bmeurer/mstarzinger): Add support for lowering inside try
+ // blocks rewiring the IfException edge to a runtime call/throw.
+ exit_controls.push_back(this_control);
+ continue;
+ } else {
+ this_value = jsgraph()->UndefinedConstant();
+ }
+ } else if (access_info.IsDataConstant()) {
this_value = jsgraph()->Constant(access_info.constant());
if (access_mode == PropertyAccessMode::kStore) {
Node* check = graph()->NewNode(
@@ -586,7 +597,9 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
// Generate the final merge point for all (polymorphic) branches.
int const control_count = static_cast<int>(controls.size());
- if (control_count == 1) {
+ if (control_count == 0) {
+ value = effect = control = jsgraph()->Dead();
+ } else if (control_count == 1) {
value = values.front();
effect = effects.front();
control = controls.front();
@@ -618,7 +631,7 @@ Reduction JSNativeContextSpecialization::ReduceJSLoadNamed(Node* node) {
// Try to lower the named access based on the {receiver_maps}.
return ReduceNamedAccess(node, value, receiver_maps, p.name(),
- PropertyAccessMode::kLoad);
+ PropertyAccessMode::kLoad, p.language_mode());
}
@@ -636,7 +649,7 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreNamed(Node* node) {
// Try to lower the named access based on the {receiver_maps}.
return ReduceNamedAccess(node, value, receiver_maps, p.name(),
- PropertyAccessMode::kStore);
+ PropertyAccessMode::kStore, p.language_mode());
}
« no previous file with comments | « src/compiler/js-native-context-specialization.h ('k') | src/compiler/property-access-info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698