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

Side by Side Diff: src/runtime.cc

Issue 8399032: Handlify CompileConstructStub. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/stub-cache.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 8160 matching lines...) Expand 10 before | Expand all | Expand 10 after
8171 Execution::New(Handle<JSFunction>::cast(bound_function), 8171 Execution::New(Handle<JSFunction>::cast(bound_function),
8172 total_argc, *param_data, &exception); 8172 total_argc, *param_data, &exception);
8173 if (exception) { 8173 if (exception) {
8174 return Failure::Exception(); 8174 return Failure::Exception();
8175 } 8175 }
8176 ASSERT(!result.is_null()); 8176 ASSERT(!result.is_null());
8177 return *result; 8177 return *result;
8178 } 8178 }
8179 8179
8180 8180
8181 static void TrySettingInlineConstructStub(Isolate* isolate, 8181 static void TrySettingInlineConstructStub(Isolate* isolate,
ulan 2011/10/27 11:37:37 The "Try" in the name bothers me, but I cannot rem
Kevin Millikin (Chromium) 2011/10/27 12:35:24 That's OK, it's a different kind of "Try". There
8182 Handle<JSFunction> function) { 8182 Handle<JSFunction> function) {
8183 Handle<Object> prototype = isolate->factory()->null_value(); 8183 Handle<Object> prototype = isolate->factory()->null_value();
8184 if (function->has_instance_prototype()) { 8184 if (function->has_instance_prototype()) {
8185 prototype = Handle<Object>(function->instance_prototype(), isolate); 8185 prototype = Handle<Object>(function->instance_prototype(), isolate);
8186 } 8186 }
8187 if (function->shared()->CanGenerateInlineConstructor(*prototype)) { 8187 if (function->shared()->CanGenerateInlineConstructor(*prototype)) {
8188 HandleScope scope(isolate);
8189 ConstructStubCompiler compiler(isolate); 8188 ConstructStubCompiler compiler(isolate);
8190 MaybeObject* code = compiler.CompileConstructStub(*function); 8189 Handle<Code> code = compiler.CompileConstructStub(function);
8191 if (!code->IsFailure()) { 8190 function->shared()->set_construct_stub(
8192 function->shared()->set_construct_stub( 8191 Code::cast(code->ToObjectUnchecked()));
Kevin Millikin (Chromium) 2011/10/27 12:35:24 ...->set_construct_stub(*code);
8193 Code::cast(code->ToObjectUnchecked()));
8194 }
8195 } 8192 }
8196 } 8193 }
8197 8194
8198 8195
8199 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) { 8196 RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) {
8200 HandleScope scope(isolate); 8197 HandleScope scope(isolate);
8201 ASSERT(args.length() == 1); 8198 ASSERT(args.length() == 1);
8202 8199
8203 Handle<Object> constructor = args.at<Object>(0); 8200 Handle<Object> constructor = args.at<Object>(0);
8204 8201
(...skipping 5321 matching lines...) Expand 10 before | Expand all | Expand 10 after
13526 } else { 13523 } else {
13527 // Handle last resort GC and make sure to allow future allocations 13524 // Handle last resort GC and make sure to allow future allocations
13528 // to grow the heap without causing GCs (if possible). 13525 // to grow the heap without causing GCs (if possible).
13529 isolate->counters()->gc_last_resort_from_js()->Increment(); 13526 isolate->counters()->gc_last_resort_from_js()->Increment();
13530 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags); 13527 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags);
13531 } 13528 }
13532 } 13529 }
13533 13530
13534 13531
13535 } } // namespace v8::internal 13532 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698