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

Side by Side Diff: src/objects.cc

Issue 13192004: arrange to create prototypes for generators (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Explicitly add constructor properties in generator.js Created 7 years, 8 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 8385 matching lines...) Expand 10 before | Expand all | Expand 10 after
8396 8396
8397 int SharedFunctionInfo::CalculateInObjectProperties() { 8397 int SharedFunctionInfo::CalculateInObjectProperties() {
8398 return (CalculateInstanceSize() - JSObject::kHeaderSize) / kPointerSize; 8398 return (CalculateInstanceSize() - JSObject::kHeaderSize) / kPointerSize;
8399 } 8399 }
8400 8400
8401 8401
8402 bool SharedFunctionInfo::CanGenerateInlineConstructor(Object* prototype) { 8402 bool SharedFunctionInfo::CanGenerateInlineConstructor(Object* prototype) {
8403 // Check the basic conditions for generating inline constructor code. 8403 // Check the basic conditions for generating inline constructor code.
8404 if (!FLAG_inline_new 8404 if (!FLAG_inline_new
8405 || !has_only_simple_this_property_assignments() 8405 || !has_only_simple_this_property_assignments()
8406 || is_generator()
8406 || this_property_assignments_count() == 0) { 8407 || this_property_assignments_count() == 0) {
8407 return false; 8408 return false;
8408 } 8409 }
8409 8410
8410 Isolate* isolate = GetIsolate(); 8411 Isolate* isolate = GetIsolate();
8411 Heap* heap = isolate->heap(); 8412 Heap* heap = isolate->heap();
8412 8413
8413 // Traverse the proposed prototype chain looking for properties of the 8414 // Traverse the proposed prototype chain looking for properties of the
8414 // same names as are set by the inline constructor. 8415 // same names as are set by the inline constructor.
8415 for (Object* obj = prototype; 8416 for (Object* obj = prototype;
(...skipping 5954 matching lines...) Expand 10 before | Expand all | Expand 10 after
14370 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER); 14371 set_year(Smi::FromInt(year), SKIP_WRITE_BARRIER);
14371 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER); 14372 set_month(Smi::FromInt(month), SKIP_WRITE_BARRIER);
14372 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER); 14373 set_day(Smi::FromInt(day), SKIP_WRITE_BARRIER);
14373 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER); 14374 set_weekday(Smi::FromInt(weekday), SKIP_WRITE_BARRIER);
14374 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER); 14375 set_hour(Smi::FromInt(hour), SKIP_WRITE_BARRIER);
14375 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER); 14376 set_min(Smi::FromInt(min), SKIP_WRITE_BARRIER);
14376 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER); 14377 set_sec(Smi::FromInt(sec), SKIP_WRITE_BARRIER);
14377 } 14378 }
14378 14379
14379 } } // namespace v8::internal 14380 } } // namespace v8::internal
OLDNEW
« src/generator.js ('K') | « src/ia32/lithium-codegen-ia32.cc ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698