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

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: properly rebase 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 11883 matching lines...) Expand 10 before | Expand all | Expand 10 after
11894 default: 11894 default:
11895 return false; 11895 return false;
11896 } 11896 }
11897 } 11897 }
11898 11898
11899 } // namespace 11899 } // namespace
11900 #endif 11900 #endif
11901 11901
11902 11902
11903 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { 11903 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) {
11904 DCHECK(function->IsConstructor() || function->shared()->is_generator()); 11904 DCHECK(function->IsConstructor() || function->shared()->is_generator() ||
11905 function->shared()->is_async());
11905 if (function->has_initial_map()) return; 11906 if (function->has_initial_map()) return;
11906 Isolate* isolate = function->GetIsolate(); 11907 Isolate* isolate = function->GetIsolate();
11907 11908
11908 // The constructor should be compiled for the optimization hints to be 11909 // The constructor should be compiled for the optimization hints to be
11909 // available. 11910 // available.
11910 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION); 11911 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION);
11911 11912
11912 // First create a new map with the size and number of in-object properties 11913 // First create a new map with the size and number of in-object properties
11913 // suggested by the function. 11914 // suggested by the function.
11914 InstanceType instance_type; 11915 InstanceType instance_type;
11915 if (function->shared()->is_generator()) { 11916 if (function->shared()->is_generator() || function->shared()->is_async()) {
11916 instance_type = JS_GENERATOR_OBJECT_TYPE; 11917 instance_type = JS_GENERATOR_OBJECT_TYPE;
11917 } else { 11918 } else {
11918 instance_type = JS_OBJECT_TYPE; 11919 instance_type = JS_OBJECT_TYPE;
11919 } 11920 }
11920 int instance_size; 11921 int instance_size;
11921 int in_object_properties; 11922 int in_object_properties;
11922 function->CalculateInstanceSize(instance_type, 0, &instance_size, 11923 function->CalculateInstanceSize(instance_type, 0, &instance_size,
11923 &in_object_properties); 11924 &in_object_properties);
11924 11925
11925 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size); 11926 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size);
(...skipping 6320 matching lines...) Expand 10 before | Expand all | Expand 10 after
18246 if (cell->value() != *new_value) { 18247 if (cell->value() != *new_value) {
18247 cell->set_value(*new_value); 18248 cell->set_value(*new_value);
18248 Isolate* isolate = cell->GetIsolate(); 18249 Isolate* isolate = cell->GetIsolate();
18249 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18250 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18250 isolate, DependentCode::kPropertyCellChangedGroup); 18251 isolate, DependentCode::kPropertyCellChangedGroup);
18251 } 18252 }
18252 } 18253 }
18253 18254
18254 } // namespace internal 18255 } // namespace internal
18255 } // namespace v8 18256 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698