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

Side by Side Diff: src/bootstrapper.cc

Issue 1145703002: Fixed SEGV that could happen if an exception is thrown during bootstrapping. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing #@$! Created 5 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 | « no previous file | no next file » | 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/base/utils/random-number-generator.h" 9 #include "src/base/utils/random-number-generator.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 StackLimitCheck check(isolate); 1488 StackLimitCheck check(isolate);
1489 if (check.HasOverflowed()) return false; 1489 if (check.HasOverflowed()) return false;
1490 1490
1491 Handle<Context> context(isolate->context()); 1491 Handle<Context> context(isolate->context());
1492 1492
1493 Handle<String> script_name = 1493 Handle<String> script_name =
1494 isolate->factory()->NewStringFromUtf8(name).ToHandleChecked(); 1494 isolate->factory()->NewStringFromUtf8(name).ToHandleChecked();
1495 Handle<SharedFunctionInfo> function_info = Compiler::CompileScript( 1495 Handle<SharedFunctionInfo> function_info = Compiler::CompileScript(
1496 source, script_name, 0, 0, false, false, Handle<Object>(), context, NULL, 1496 source, script_name, 0, 0, false, false, Handle<Object>(), context, NULL,
1497 NULL, ScriptCompiler::kNoCompileOptions, NATIVES_CODE, false); 1497 NULL, ScriptCompiler::kNoCompileOptions, NATIVES_CODE, false);
1498 if (function_info.is_null()) return false;
1498 1499
1499 DCHECK(context->IsNativeContext()); 1500 DCHECK(context->IsNativeContext());
1500 1501
1501 Handle<Context> runtime_context(context->runtime_context()); 1502 Handle<Context> runtime_context(context->runtime_context());
1502 Handle<JSBuiltinsObject> receiver(context->builtins()); 1503 Handle<JSBuiltinsObject> receiver(context->builtins());
1503 Handle<JSFunction> fun = 1504 Handle<JSFunction> fun =
1504 isolate->factory()->NewFunctionFromSharedFunctionInfo(function_info, 1505 isolate->factory()->NewFunctionFromSharedFunctionInfo(function_info,
1505 runtime_context); 1506 runtime_context);
1506 1507
1507 // For non-extension scripts, run script to get the function wrapper. 1508 // For non-extension scripts, run script to get the function wrapper.
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after
3035 return from + sizeof(NestingCounterType); 3036 return from + sizeof(NestingCounterType);
3036 } 3037 }
3037 3038
3038 3039
3039 // Called when the top-level V8 mutex is destroyed. 3040 // Called when the top-level V8 mutex is destroyed.
3040 void Bootstrapper::FreeThreadResources() { 3041 void Bootstrapper::FreeThreadResources() {
3041 DCHECK(!IsActive()); 3042 DCHECK(!IsActive());
3042 } 3043 }
3043 3044
3044 } } // namespace v8::internal 3045 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698