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

Side by Side Diff: src/runtime.cc

Issue 113634: Propagate information on whether a non function was called as constructor or not (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime.h ('k') | src/runtime.js » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 4340 matching lines...) Expand 10 before | Expand all | Expand 10 after
4351 4351
4352 4352
4353 static Object* Runtime_GetFunctionDelegate(Arguments args) { 4353 static Object* Runtime_GetFunctionDelegate(Arguments args) {
4354 HandleScope scope; 4354 HandleScope scope;
4355 ASSERT(args.length() == 1); 4355 ASSERT(args.length() == 1);
4356 RUNTIME_ASSERT(!args[0]->IsJSFunction()); 4356 RUNTIME_ASSERT(!args[0]->IsJSFunction());
4357 return *Execution::GetFunctionDelegate(args.at<Object>(0)); 4357 return *Execution::GetFunctionDelegate(args.at<Object>(0));
4358 } 4358 }
4359 4359
4360 4360
4361 static Object* Runtime_GetConstructorDelegate(Arguments args) {
4362 HandleScope scope;
4363 ASSERT(args.length() == 1);
4364 RUNTIME_ASSERT(!args[0]->IsJSFunction());
4365 return *Execution::GetConstructorDelegate(args.at<Object>(0));
4366 }
4367
4368
4361 static Object* Runtime_NewContext(Arguments args) { 4369 static Object* Runtime_NewContext(Arguments args) {
4362 NoHandleAllocation ha; 4370 NoHandleAllocation ha;
4363 ASSERT(args.length() == 1); 4371 ASSERT(args.length() == 1);
4364 4372
4365 CONVERT_CHECKED(JSFunction, function, args[0]); 4373 CONVERT_CHECKED(JSFunction, function, args[0]);
4366 int length = ScopeInfo<>::NumberOfContextSlots(function->code()); 4374 int length = ScopeInfo<>::NumberOfContextSlots(function->code());
4367 Object* result = Heap::AllocateFunctionContext(length, function); 4375 Object* result = Heap::AllocateFunctionContext(length, function);
4368 if (result->IsFailure()) return result; 4376 if (result->IsFailure()) return result;
4369 4377
4370 Top::set_context(Context::cast(result)); 4378 Top::set_context(Context::cast(result));
(...skipping 2658 matching lines...) Expand 10 before | Expand all | Expand 10 after
7029 } else { 7037 } else {
7030 // Handle last resort GC and make sure to allow future allocations 7038 // Handle last resort GC and make sure to allow future allocations
7031 // to grow the heap without causing GCs (if possible). 7039 // to grow the heap without causing GCs (if possible).
7032 Counters::gc_last_resort_from_js.Increment(); 7040 Counters::gc_last_resort_from_js.Increment();
7033 Heap::CollectAllGarbage(); 7041 Heap::CollectAllGarbage();
7034 } 7042 }
7035 } 7043 }
7036 7044
7037 7045
7038 } } // namespace v8::internal 7046 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/runtime.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698