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

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: remove weird arrow-generator thing 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 11895 matching lines...) Expand 10 before | Expand all | Expand 10 after
11906 default: 11906 default:
11907 return false; 11907 return false;
11908 } 11908 }
11909 } 11909 }
11910 11910
11911 } // namespace 11911 } // namespace
11912 #endif 11912 #endif
11913 11913
11914 11914
11915 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) { 11915 void JSFunction::EnsureHasInitialMap(Handle<JSFunction> function) {
11916 DCHECK(function->IsConstructor() || function->shared()->is_generator()); 11916 DCHECK(function->IsConstructor() || function->shared()->is_generator() ||
11917 function->shared()->is_async());
11917 if (function->has_initial_map()) return; 11918 if (function->has_initial_map()) return;
11918 Isolate* isolate = function->GetIsolate(); 11919 Isolate* isolate = function->GetIsolate();
11919 11920
11920 // The constructor should be compiled for the optimization hints to be 11921 // The constructor should be compiled for the optimization hints to be
11921 // available. 11922 // available.
11922 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION); 11923 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION);
11923 11924
11924 // First create a new map with the size and number of in-object properties 11925 // First create a new map with the size and number of in-object properties
11925 // suggested by the function. 11926 // suggested by the function.
11926 InstanceType instance_type; 11927 InstanceType instance_type;
11927 if (function->shared()->is_generator()) { 11928 if (function->shared()->is_generator() || function->shared()->is_async()) {
11928 instance_type = JS_GENERATOR_OBJECT_TYPE; 11929 instance_type = JS_GENERATOR_OBJECT_TYPE;
11929 } else { 11930 } else {
11930 instance_type = JS_OBJECT_TYPE; 11931 instance_type = JS_OBJECT_TYPE;
11931 } 11932 }
11932 int instance_size; 11933 int instance_size;
11933 int in_object_properties; 11934 int in_object_properties;
11934 function->CalculateInstanceSize(instance_type, 0, &instance_size, 11935 function->CalculateInstanceSize(instance_type, 0, &instance_size,
11935 &in_object_properties); 11936 &in_object_properties);
11936 11937
11937 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size); 11938 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size);
(...skipping 6320 matching lines...) Expand 10 before | Expand all | Expand 10 after
18258 if (cell->value() != *new_value) { 18259 if (cell->value() != *new_value) {
18259 cell->set_value(*new_value); 18260 cell->set_value(*new_value);
18260 Isolate* isolate = cell->GetIsolate(); 18261 Isolate* isolate = cell->GetIsolate();
18261 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18262 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18262 isolate, DependentCode::kPropertyCellChangedGroup); 18263 isolate, DependentCode::kPropertyCellChangedGroup);
18263 } 18264 }
18264 } 18265 }
18265 18266
18266 } // namespace internal 18267 } // namespace internal
18267 } // namespace v8 18268 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698