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

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: fix some nits 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
« no previous file with comments | « src/js/promise.js ('k') | src/parsing/parser.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 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_resumable());
11952 if (function->has_initial_map()) return; 11952 if (function->has_initial_map()) return;
11953 Isolate* isolate = function->GetIsolate(); 11953 Isolate* isolate = function->GetIsolate();
11954 11954
11955 // The constructor should be compiled for the optimization hints to be 11955 // The constructor should be compiled for the optimization hints to be
11956 // available. 11956 // available.
11957 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION); 11957 Compiler::Compile(function, Compiler::CLEAR_EXCEPTION);
11958 11958
11959 // First create a new map with the size and number of in-object properties 11959 // First create a new map with the size and number of in-object properties
11960 // suggested by the function. 11960 // suggested by the function.
11961 InstanceType instance_type; 11961 InstanceType instance_type;
11962 if (function->shared()->is_generator()) { 11962 if (function->shared()->is_resumable()) {
11963 instance_type = JS_GENERATOR_OBJECT_TYPE; 11963 instance_type = JS_GENERATOR_OBJECT_TYPE;
11964 } else { 11964 } else {
11965 instance_type = JS_OBJECT_TYPE; 11965 instance_type = JS_OBJECT_TYPE;
11966 } 11966 }
11967 int instance_size; 11967 int instance_size;
11968 int in_object_properties; 11968 int in_object_properties;
11969 function->CalculateInstanceSize(instance_type, 0, &instance_size, 11969 function->CalculateInstanceSize(instance_type, 0, &instance_size,
11970 &in_object_properties); 11970 &in_object_properties);
11971 11971
11972 Handle<Map> map = isolate->factory()->NewMap(instance_type, instance_size); 11972 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) { 18293 if (cell->value() != *new_value) {
18294 cell->set_value(*new_value); 18294 cell->set_value(*new_value);
18295 Isolate* isolate = cell->GetIsolate(); 18295 Isolate* isolate = cell->GetIsolate();
18296 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18296 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18297 isolate, DependentCode::kPropertyCellChangedGroup); 18297 isolate, DependentCode::kPropertyCellChangedGroup);
18298 } 18298 }
18299 } 18299 }
18300 18300
18301 } // namespace internal 18301 } // namespace internal
18302 } // namespace v8 18302 } // namespace v8
OLDNEW
« no previous file with comments | « src/js/promise.js ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698