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

Side by Side Diff: src/runtime.cc

Issue 8099: Collects unused maps that are only kept alive by map transitions.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 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/property.h ('k') | 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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 ASSERT(args.length() == 1); 313 ASSERT(args.length() == 1);
314 Object* arg = args[0]; 314 Object* arg = args[0];
315 bool result = arg->IsObjectTemplateInfo() || arg->IsFunctionTemplateInfo(); 315 bool result = arg->IsObjectTemplateInfo() || arg->IsFunctionTemplateInfo();
316 return Heap::ToBoolean(result); 316 return Heap::ToBoolean(result);
317 } 317 }
318 318
319 319
320 static Object* Runtime_GetTemplateField(Arguments args) { 320 static Object* Runtime_GetTemplateField(Arguments args) {
321 ASSERT(args.length() == 2); 321 ASSERT(args.length() == 2);
322 CONVERT_CHECKED(HeapObject, templ, args[0]); 322 CONVERT_CHECKED(HeapObject, templ, args[0]);
323 RUNTIME_ASSERT(templ->IsStruct());
324 CONVERT_CHECKED(Smi, field, args[1]); 323 CONVERT_CHECKED(Smi, field, args[1]);
325 return HeapObject::GetHeapObjectField(templ, field->value()); 324 int index = field->value();
325 int offset = index * kPointerSize + HeapObject::kHeaderSize;
326 InstanceType type = templ->map()->instance_type();
327 RUNTIME_ASSERT(type == FUNCTION_TEMPLATE_INFO_TYPE ||
328 type == OBJECT_TEMPLATE_INFO_TYPE);
329 RUNTIME_ASSERT(offset > 0);
330 RUNTIME_ASSERT(offset < ((type == FUNCTION_TEMPLATE_INFO_TYPE) ?
331 FunctionTemplateInfo::kSize : ObjectTemplateInfo::kSize));
332 return HeapObject::RawField(templ, offset);
326 } 333 }
327 334
328 335
329 static Object* ThrowRedeclarationError(const char* type, Handle<String> name) { 336 static Object* ThrowRedeclarationError(const char* type, Handle<String> name) {
330 HandleScope scope; 337 HandleScope scope;
331 Handle<Object> type_handle = Factory::NewStringFromAscii(CStrVector(type)); 338 Handle<Object> type_handle = Factory::NewStringFromAscii(CStrVector(type));
332 Handle<Object> args[2] = { type_handle, name }; 339 Handle<Object> args[2] = { type_handle, name };
333 Handle<Object> error = 340 Handle<Object> error =
334 Factory::NewTypeError("redeclaration", HandleVector(args, 2)); 341 Factory::NewTypeError("redeclaration", HandleVector(args, 2));
335 return Top::Throw(*error); 342 return Top::Throw(*error);
(...skipping 5187 matching lines...) Expand 10 before | Expand all | Expand 10 after
5523 5530
5524 void Runtime::PerformGC(Object* result) { 5531 void Runtime::PerformGC(Object* result) {
5525 Failure* failure = Failure::cast(result); 5532 Failure* failure = Failure::cast(result);
5526 // Try to do a garbage collection; ignore it if it fails. The C 5533 // Try to do a garbage collection; ignore it if it fails. The C
5527 // entry stub will throw an out-of-memory exception in that case. 5534 // entry stub will throw an out-of-memory exception in that case.
5528 Heap::CollectGarbage(failure->requested(), failure->allocation_space()); 5535 Heap::CollectGarbage(failure->requested(), failure->allocation_space());
5529 } 5536 }
5530 5537
5531 5538
5532 } } // namespace v8::internal 5539 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/property.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698