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/runtime/runtime-array.cc

Issue 1153403002: [turbofan] Simplify graph construction for for-in. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/ast-graph-builder.cc ('k') | 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 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/messages.h" 8 #include "src/messages.h"
9 #include "src/runtime/runtime-utils.h" 9 #include "src/runtime/runtime-utils.h"
10 10
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 // This simulates CONVERT_ARG_HANDLE_CHECKED for calls returning pairs. 1311 // This simulates CONVERT_ARG_HANDLE_CHECKED for calls returning pairs.
1312 // Not worth creating a macro atm as this function should be removed. 1312 // Not worth creating a macro atm as this function should be removed.
1313 if (!args[0]->IsJSReceiver() || !args[1]->IsObject()) { 1313 if (!args[0]->IsJSReceiver() || !args[1]->IsObject()) {
1314 Object* error = isolate->ThrowIllegalOperation(); 1314 Object* error = isolate->ThrowIllegalOperation();
1315 return MakePair(error, isolate->heap()->undefined_value()); 1315 return MakePair(error, isolate->heap()->undefined_value());
1316 } 1316 }
1317 Handle<JSReceiver> object = args.at<JSReceiver>(0); 1317 Handle<JSReceiver> object = args.at<JSReceiver>(0);
1318 Handle<Object> cache_type = args.at<Object>(1); 1318 Handle<Object> cache_type = args.at<Object>(1);
1319 if (cache_type->IsMap()) { 1319 if (cache_type->IsMap()) {
1320 // Enum cache case. 1320 // Enum cache case.
1321 if (Map::EnumLengthBits::decode(Map::cast(*cache_type)->bit_field3()) == 1321 return MakePair(Map::cast(*cache_type)->EnumLength() != 0
1322 0) { 1322 ? object->map()->instance_descriptors()->GetEnumCache()
1323 // 0 length enum. 1323 : isolate->heap()->empty_fixed_array(),
1324 // Can't handle this case in the graph builder,
1325 // so transform it into the empty fixed array case.
1326 return MakePair(isolate->heap()->empty_fixed_array(), Smi::FromInt(1));
1327 }
1328 return MakePair(object->map()->instance_descriptors()->GetEnumCache(),
1329 *cache_type); 1324 *cache_type);
1330 } else { 1325 } else {
1331 // FixedArray case. 1326 // FixedArray case.
1332 Smi* new_cache_type = Smi::FromInt(object->IsJSProxy() ? 0 : 1); 1327 Smi* new_cache_type = Smi::FromInt(object->IsJSProxy() ? 0 : 1);
1333 return MakePair(*Handle<FixedArray>::cast(cache_type), new_cache_type); 1328 return MakePair(*Handle<FixedArray>::cast(cache_type), new_cache_type);
1334 } 1329 }
1335 } 1330 }
1336 1331
1337 1332
1338 // TODO(dcarney): remove this function when TurboFan supports it. 1333 // TODO(dcarney): remove this function when TurboFan supports it.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 1408
1414 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) { 1409 RUNTIME_FUNCTION(Runtime_FastOneByteArrayJoin) {
1415 SealHandleScope shs(isolate); 1410 SealHandleScope shs(isolate);
1416 DCHECK(args.length() == 2); 1411 DCHECK(args.length() == 2);
1417 // Returning undefined means that this fast path fails and one has to resort 1412 // Returning undefined means that this fast path fails and one has to resort
1418 // to a slow path. 1413 // to a slow path.
1419 return isolate->heap()->undefined_value(); 1414 return isolate->heap()->undefined_value();
1420 } 1415 }
1421 } // namespace internal 1416 } // namespace internal
1422 } // namespace v8 1417 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698