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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1406113007: Merge GlobalObject with JSGlobalObject. (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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | src/contexts.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/code-factory.h" 5 #include "src/code-factory.h"
6 #include "src/compiler/access-builder.h" 6 #include "src/compiler/access-builder.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-typed-lowering.h" 8 #include "src/compiler/js-typed-lowering.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 Handle<Context>::cast(context_type->AsConstant()->Value()) 1244 Handle<Context>::cast(context_type->AsConstant()->Value())
1245 ->global_proxy(), 1245 ->global_proxy(),
1246 isolate()); 1246 isolate());
1247 receiver = jsgraph()->Constant(global_proxy); 1247 receiver = jsgraph()->Constant(global_proxy);
1248 } else { 1248 } else {
1249 Node* global_object = effect = graph()->NewNode( 1249 Node* global_object = effect = graph()->NewNode(
1250 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true), 1250 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true),
1251 context, context, effect); 1251 context, context, effect);
1252 receiver = effect = 1252 receiver = effect =
1253 graph()->NewNode(simplified()->LoadField( 1253 graph()->NewNode(simplified()->LoadField(
1254 AccessBuilder::ForGlobalObjectGlobalProxy()), 1254 AccessBuilder::ForJSGlobalObjectGlobalProxy()),
1255 global_object, effect, control); 1255 global_object, effect, control);
1256 } 1256 }
1257 } else if (!receiver_type->Maybe(Type::NullOrUndefined()) || 1257 } else if (!receiver_type->Maybe(Type::NullOrUndefined()) ||
1258 mode == ConvertReceiverMode::kNotNullOrUndefined) { 1258 mode == ConvertReceiverMode::kNotNullOrUndefined) {
1259 receiver = effect = 1259 receiver = effect =
1260 graph()->NewNode(javascript()->ToObject(), receiver, context, 1260 graph()->NewNode(javascript()->ToObject(), receiver, context,
1261 frame_state, effect, control); 1261 frame_state, effect, control);
1262 } else { 1262 } else {
1263 // Check {receiver} for undefined. 1263 // Check {receiver} for undefined.
1264 Node* check0 = 1264 Node* check0 =
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1297 if (context_type->IsConstant()) { 1297 if (context_type->IsConstant()) {
1298 Handle<JSObject> global_proxy( 1298 Handle<JSObject> global_proxy(
1299 Handle<Context>::cast(context_type->AsConstant()->Value()) 1299 Handle<Context>::cast(context_type->AsConstant()->Value())
1300 ->global_proxy(), 1300 ->global_proxy(),
1301 isolate()); 1301 isolate());
1302 rglobal = jsgraph()->Constant(global_proxy); 1302 rglobal = jsgraph()->Constant(global_proxy);
1303 } else { 1303 } else {
1304 Node* global_object = eglobal = graph()->NewNode( 1304 Node* global_object = eglobal = graph()->NewNode(
1305 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true), 1305 javascript()->LoadContext(0, Context::GLOBAL_OBJECT_INDEX, true),
1306 context, context, eglobal); 1306 context, context, eglobal);
1307 rglobal = eglobal = 1307 rglobal = eglobal = graph()->NewNode(
1308 graph()->NewNode(simplified()->LoadField( 1308 simplified()->LoadField(
1309 AccessBuilder::ForGlobalObjectGlobalProxy()), 1309 AccessBuilder::ForJSGlobalObjectGlobalProxy()),
1310 global_object, eglobal, if_global); 1310 global_object, eglobal, if_global);
1311 } 1311 }
1312 } 1312 }
1313 1313
1314 control = graph()->NewNode(common()->Merge(2), if_convert, if_global); 1314 control = graph()->NewNode(common()->Merge(2), if_convert, if_global);
1315 effect = 1315 effect =
1316 graph()->NewNode(common()->EffectPhi(2), econvert, eglobal, control); 1316 graph()->NewNode(common()->EffectPhi(2), econvert, eglobal, control);
1317 receiver = graph()->NewNode(common()->Phi(kMachAnyTagged, 2), rconvert, 1317 receiver = graph()->NewNode(common()->Phi(kMachAnyTagged, 2), rconvert,
1318 rglobal, control); 1318 rglobal, control);
1319 } 1319 }
1320 } 1320 }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 FrameStateInfo args_state_info = OpParameter<FrameStateInfo>(args_state); 1390 FrameStateInfo args_state_info = OpParameter<FrameStateInfo>(args_state);
1391 // Prepare element backing store to be used by arguments object. 1391 // Prepare element backing store to be used by arguments object.
1392 bool has_aliased_arguments = false; 1392 bool has_aliased_arguments = false;
1393 Node* const elements = AllocateAliasedArguments( 1393 Node* const elements = AllocateAliasedArguments(
1394 effect, control, args_state, context, shared, &has_aliased_arguments); 1394 effect, control, args_state, context, shared, &has_aliased_arguments);
1395 // Load the arguments object map from the current native context. 1395 // Load the arguments object map from the current native context.
1396 Node* const load_global_object = graph()->NewNode( 1396 Node* const load_global_object = graph()->NewNode(
1397 simplified()->LoadField( 1397 simplified()->LoadField(
1398 AccessBuilder::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)), 1398 AccessBuilder::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)),
1399 context, effect, control); 1399 context, effect, control);
1400 Node* const load_native_context = graph()->NewNode( 1400 Node* const load_native_context =
1401 simplified()->LoadField(AccessBuilder::ForGlobalObjectNativeContext()), 1401 graph()->NewNode(simplified()->LoadField(
1402 load_global_object, effect, control); 1402 AccessBuilder::ForJSGlobalObjectNativeContext()),
1403 load_global_object, effect, control);
1403 Node* const load_arguments_map = graph()->NewNode( 1404 Node* const load_arguments_map = graph()->NewNode(
1404 simplified()->LoadField(AccessBuilder::ForContextSlot( 1405 simplified()->LoadField(AccessBuilder::ForContextSlot(
1405 has_aliased_arguments ? Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX 1406 has_aliased_arguments ? Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX
1406 : Context::SLOPPY_ARGUMENTS_MAP_INDEX)), 1407 : Context::SLOPPY_ARGUMENTS_MAP_INDEX)),
1407 load_native_context, effect, control); 1408 load_native_context, effect, control);
1408 // Actually allocate and initialize the arguments object. 1409 // Actually allocate and initialize the arguments object.
1409 AllocationBuilder a(jsgraph(), effect, control); 1410 AllocationBuilder a(jsgraph(), effect, control);
1410 Node* properties = jsgraph()->EmptyFixedArrayConstant(); 1411 Node* properties = jsgraph()->EmptyFixedArrayConstant();
1411 int length = args_state_info.parameter_count() - 1; // Minus receiver. 1412 int length = args_state_info.parameter_count() - 1; // Minus receiver.
1412 STATIC_ASSERT(Heap::kSloppyArgumentsObjectSize == 5 * kPointerSize); 1413 STATIC_ASSERT(Heap::kSloppyArgumentsObjectSize == 5 * kPointerSize);
(...skipping 19 matching lines...) Expand all
1432 // there conceptually is an arguments adaptor frame in the call chain. 1433 // there conceptually is an arguments adaptor frame in the call chain.
1433 Node* const args_state = GetArgumentsFrameState(frame_state); 1434 Node* const args_state = GetArgumentsFrameState(frame_state);
1434 FrameStateInfo args_state_info = OpParameter<FrameStateInfo>(args_state); 1435 FrameStateInfo args_state_info = OpParameter<FrameStateInfo>(args_state);
1435 // Prepare element backing store to be used by arguments object. 1436 // Prepare element backing store to be used by arguments object.
1436 Node* const elements = AllocateArguments(effect, control, args_state); 1437 Node* const elements = AllocateArguments(effect, control, args_state);
1437 // Load the arguments object map from the current native context. 1438 // Load the arguments object map from the current native context.
1438 Node* const load_global_object = graph()->NewNode( 1439 Node* const load_global_object = graph()->NewNode(
1439 simplified()->LoadField( 1440 simplified()->LoadField(
1440 AccessBuilder::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)), 1441 AccessBuilder::ForContextSlot(Context::GLOBAL_OBJECT_INDEX)),
1441 context, effect, control); 1442 context, effect, control);
1442 Node* const load_native_context = graph()->NewNode( 1443 Node* const load_native_context =
1443 simplified()->LoadField(AccessBuilder::ForGlobalObjectNativeContext()), 1444 graph()->NewNode(simplified()->LoadField(
1444 load_global_object, effect, control); 1445 AccessBuilder::ForJSGlobalObjectNativeContext()),
1446 load_global_object, effect, control);
1445 Node* const load_arguments_map = graph()->NewNode( 1447 Node* const load_arguments_map = graph()->NewNode(
1446 simplified()->LoadField( 1448 simplified()->LoadField(
1447 AccessBuilder::ForContextSlot(Context::STRICT_ARGUMENTS_MAP_INDEX)), 1449 AccessBuilder::ForContextSlot(Context::STRICT_ARGUMENTS_MAP_INDEX)),
1448 load_native_context, effect, control); 1450 load_native_context, effect, control);
1449 // Actually allocate and initialize the arguments object. 1451 // Actually allocate and initialize the arguments object.
1450 AllocationBuilder a(jsgraph(), effect, control); 1452 AllocationBuilder a(jsgraph(), effect, control);
1451 Node* properties = jsgraph()->EmptyFixedArrayConstant(); 1453 Node* properties = jsgraph()->EmptyFixedArrayConstant();
1452 int length = args_state_info.parameter_count() - 1; // Minus receiver. 1454 int length = args_state_info.parameter_count() - 1; // Minus receiver.
1453 STATIC_ASSERT(Heap::kStrictArgumentsObjectSize == 4 * kPointerSize); 1455 STATIC_ASSERT(Heap::kStrictArgumentsObjectSize == 4 * kPointerSize);
1454 a.Allocate(Heap::kStrictArgumentsObjectSize); 1456 a.Allocate(Heap::kStrictArgumentsObjectSize);
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
2235 } 2237 }
2236 2238
2237 2239
2238 MachineOperatorBuilder* JSTypedLowering::machine() const { 2240 MachineOperatorBuilder* JSTypedLowering::machine() const {
2239 return jsgraph()->machine(); 2241 return jsgraph()->machine();
2240 } 2242 }
2241 2243
2242 } // namespace compiler 2244 } // namespace compiler
2243 } // namespace internal 2245 } // namespace internal
2244 } // namespace v8 2246 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-native-context-specialization.cc ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698