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

Side by Side Diff: src/bootstrapper.cc

Issue 1551473002: [builtins] Fix context for ConstructStub calls into C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE Created 4 years, 11 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/arm64/builtins-arm64.cc ('k') | src/builtins.cc » ('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 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 } 1201 }
1202 } 1202 }
1203 1203
1204 { 1204 {
1205 // --- S y m b o l --- 1205 // --- S y m b o l ---
1206 Handle<JSFunction> symbol_fun = InstallFunction( 1206 Handle<JSFunction> symbol_fun = InstallFunction(
1207 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize, 1207 global, "Symbol", JS_VALUE_TYPE, JSValue::kSize,
1208 isolate->initial_object_prototype(), Builtins::kSymbolConstructor); 1208 isolate->initial_object_prototype(), Builtins::kSymbolConstructor);
1209 symbol_fun->shared()->set_construct_stub( 1209 symbol_fun->shared()->set_construct_stub(
1210 *isolate->builtins()->SymbolConstructor_ConstructStub()); 1210 *isolate->builtins()->SymbolConstructor_ConstructStub());
1211 symbol_fun->shared()->set_internal_formal_parameter_count(1);
1212 symbol_fun->shared()->set_length(1); 1211 symbol_fun->shared()->set_length(1);
1212 symbol_fun->shared()->DontAdaptArguments();
1213 native_context()->set_symbol_function(*symbol_fun); 1213 native_context()->set_symbol_function(*symbol_fun);
1214 } 1214 }
1215 1215
1216 { // --- D a t e --- 1216 { // --- D a t e ---
1217 // Builtin functions for Date.prototype. 1217 // Builtin functions for Date.prototype.
1218 Handle<JSFunction> date_fun = InstallFunction( 1218 Handle<JSFunction> date_fun = InstallFunction(
1219 global, "Date", JS_DATE_TYPE, JSDate::kSize, 1219 global, "Date", JS_DATE_TYPE, JSDate::kSize,
1220 isolate->initial_object_prototype(), Builtins::kIllegal); 1220 isolate->initial_object_prototype(), Builtins::kIllegal);
1221 InstallWithIntrinsicDefaultProto(isolate, date_fun, 1221 InstallWithIntrinsicDefaultProto(isolate, date_fun,
1222 Context::DATE_FUNCTION_INDEX); 1222 Context::DATE_FUNCTION_INDEX);
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
2457 Handle<JSFunction> string_function(native_context()->string_function()); 2457 Handle<JSFunction> string_function(native_context()->string_function());
2458 DCHECK(JSObject::cast( 2458 DCHECK(JSObject::cast(
2459 string_function->initial_map()->prototype())->HasFastProperties()); 2459 string_function->initial_map()->prototype())->HasFastProperties());
2460 native_context()->set_string_function_prototype_map( 2460 native_context()->set_string_function_prototype_map(
2461 HeapObject::cast(string_function->initial_map()->prototype())->map()); 2461 HeapObject::cast(string_function->initial_map()->prototype())->map());
2462 2462
2463 // Install Global.eval. 2463 // Install Global.eval.
2464 { 2464 {
2465 Handle<JSFunction> eval = SimpleInstallFunction( 2465 Handle<JSFunction> eval = SimpleInstallFunction(
2466 handle(native_context()->global_object()), factory()->eval_string(), 2466 handle(native_context()->global_object()), factory()->eval_string(),
2467 Builtins::kGlobalEval, 1, true); 2467 Builtins::kGlobalEval, 1, false);
2468 native_context()->set_global_eval_fun(*eval); 2468 native_context()->set_global_eval_fun(*eval);
2469 } 2469 }
2470 2470
2471 // Install Date.prototype[@@toPrimitive]. 2471 // Install Date.prototype[@@toPrimitive].
2472 { 2472 {
2473 Handle<String> key = factory()->Date_string(); 2473 Handle<String> key = factory()->Date_string();
2474 Handle<JSFunction> date = Handle<JSFunction>::cast( 2474 Handle<JSFunction> date = Handle<JSFunction>::cast(
2475 Object::GetProperty(handle(native_context()->global_object()), key) 2475 Object::GetProperty(handle(native_context()->global_object()), key)
2476 .ToHandleChecked()); 2476 .ToHandleChecked());
2477 Handle<JSObject> proto = 2477 Handle<JSObject> proto =
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
3357 } 3357 }
3358 3358
3359 3359
3360 // Called when the top-level V8 mutex is destroyed. 3360 // Called when the top-level V8 mutex is destroyed.
3361 void Bootstrapper::FreeThreadResources() { 3361 void Bootstrapper::FreeThreadResources() {
3362 DCHECK(!IsActive()); 3362 DCHECK(!IsActive());
3363 } 3363 }
3364 3364
3365 } // namespace internal 3365 } // namespace internal
3366 } // namespace v8 3366 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698