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

Side by Side Diff: src/objects.cc

Issue 1895603002: [esnext] prototype runtime implementation for async functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AsyncFunction
Patch Set: Don't put assert*Async helpers in mjsunit.js Created 4 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
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/objects.h" 5 #include "src/objects.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <iomanip> 8 #include <iomanip>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 11930 matching lines...) Expand 10 before | Expand all | Expand 10 after
11941 default: 11941 default:
11942 return false; 11942 return false;
11943 } 11943 }
11944 } 11944 }
11945 11945
11946 } // namespace 11946 } // namespace
11947 #endif 11947 #endif
11948 11948
11949 11949
11950 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { 11950 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) {
11951 DCHECK(function->IsConstructor() || function->shared()->is_generator()); 11951 DCHECK(function->IsConstructor() || function->shared()->is_generator() ||
11952 function->shared()->is_async());
Dan Ehrenberg 2016/05/16 23:01:16 Nit: use is_resumable()
caitp (gmail) 2016/05/16 23:08:30 Done.
11952 if (function->has_initial_map()) return; 11953 if (function->has_initial_map()) return;
11953 Isolate* isolate = function->GetIsolate(); 11954 Isolate* isolate = function->GetIsolate();
11954 11955
11955 // The constructor should be compiled for the optimization hints to be 11956 // The constructor should be compiled for the optimization hints to be
11956 // available. 11957 // available.
11957 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION); 11958 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION);
11958 11959
11959 // First create a new map with the size and number of in-object properties 11960 // First create a new map with the size and number of in-object properties
11960 // suggested by the function. 11961 // suggested by the function.
11961 InstanceType instance_type; 11962 InstanceType instance_type;
11962 if (function->shared()->is_generator()) { 11963 if (function->shared()->is_generator() || function->shared()->is_async()) {
Dan Ehrenberg 2016/05/16 23:01:16 Nit: use is_resumable()
caitp (gmail) 2016/05/16 23:08:30 Done.
11963 instance_type = JS_GENERATOR_OBJECT_TYPE; 11964 instance_type = JS_GENERATOR_OBJECT_TYPE;
11964 } else { 11965 } else {
11965 instance_type = JS_OBJECT_TYPE; 11966 instance_type = JS_OBJECT_TYPE;
11966 } 11967 }
11967 int instance_size; 11968 int instance_size;
11968 int in_object_properties; 11969 int in_object_properties;
11969 function->CalculateInstanceSize(instance_type, 0, &instance_size, 11970 function->CalculateInstanceSize(instance_type, 0, &instance_size,
11970 &in_object_properties); 11971 &in_object_properties);
11971 11972
11972 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size); 11973 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size);
(...skipping 6320 matching lines...) Expand 10 before | Expand all | Expand 10 after
18293 if (cell->value() != *new_value) { 18294 if (cell->value() != *new_value) {
18294 cell->set_value(*new_value); 18295 cell->set_value(*new_value);
18295 Isolate* isolate = cell->GetIsolate(); 18296 Isolate* isolate = cell->GetIsolate();
18296 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18297 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18297 isolate, DependentCode::kPropertyCellChangedGroup); 18298 isolate, DependentCode::kPropertyCellChangedGroup);
18298 } 18299 }
18299 } 18300 }
18300 18301
18301 } // namespace internal 18302 } // namespace internal
18302 } // namespace v8 18303 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698