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

Side by Side Diff: src/code-stubs.cc

Issue 1213203007: Create a internal, global native context used only for generated code stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 years, 5 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/code-stubs.h" 5 #include "src/code-stubs.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 } 460 }
461 TraceTransition(old_state, state); 461 TraceTransition(old_state, state);
462 set_sub_minor_key(TypesBits::update(sub_minor_key(), state.ToIntegral())); 462 set_sub_minor_key(TypesBits::update(sub_minor_key(), state.ToIntegral()));
463 } 463 }
464 464
465 465
466 namespace { 466 namespace {
467 467
468 Handle<JSFunction> GetFunction(Isolate* isolate, const char* name) { 468 Handle<JSFunction> GetFunction(Isolate* isolate, const char* name) {
469 v8::ExtensionConfiguration no_extensions; 469 v8::ExtensionConfiguration no_extensions;
470 Handle<Context> ctx = isolate->bootstrapper()->CreateEnvironment( 470 MaybeHandle<Object> fun = Object::GetProperty(
471 MaybeHandle<JSGlobalProxy>(), v8::Local<v8::ObjectTemplate>(), 471 isolate, Handle<JSObject>(isolate->heap()->code_stub_exports_object()),
Michael Starzinger 2015/07/10 13:26:30 nit: Just use isolate->factory()->code_stub_export
danno 2015/07/13 09:43:37 Done
472 &no_extensions); 472 name);
473 Handle<JSBuiltinsObject> builtins = handle(ctx->builtins());
474 MaybeHandle<Object> fun = Object::GetProperty(isolate, builtins, name);
475 Handle<JSFunction> function = Handle<JSFunction>::cast(fun.ToHandleChecked()); 473 Handle<JSFunction> function = Handle<JSFunction>::cast(fun.ToHandleChecked());
476 DCHECK(!function->IsUndefined() && 474 DCHECK(!function->IsUndefined() &&
477 "JavaScript implementation of stub not found"); 475 "JavaScript implementation of stub not found");
478 return function; 476 return function;
479 } 477 }
480 } // namespace 478 } // namespace
481 479
482 480
483 Handle<Code> TurboFanCodeStub::GenerateCode() { 481 Handle<Code> TurboFanCodeStub::GenerateCode() {
484 // Get the outer ("stub generator") function. 482 // Get the outer ("stub generator") function.
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 1059
1062 if (type->Is(Type::UntaggedPointer())) { 1060 if (type->Is(Type::UntaggedPointer())) {
1063 return Representation::External(); 1061 return Representation::External();
1064 } 1062 }
1065 1063
1066 DCHECK(!type->Is(Type::Untagged())); 1064 DCHECK(!type->Is(Type::Untagged()));
1067 return Representation::Tagged(); 1065 return Representation::Tagged();
1068 } 1066 }
1069 } // namespace internal 1067 } // namespace internal
1070 } // namespace v8 1068 } // namespace v8
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | src/code-stubs.js » ('j') | test/cctest/test-api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698