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

Side by Side Diff: src/ic.cc

Issue 8111006: Allow new-space JSFunction objects as constant-function properties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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
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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 switch (lookup->type()) { 1000 switch (lookup->type()) {
1001 case FIELD: { 1001 case FIELD: {
1002 maybe_code = isolate()->stub_cache()->ComputeLoadField( 1002 maybe_code = isolate()->stub_cache()->ComputeLoadField(
1003 *name, 1003 *name,
1004 *receiver, 1004 *receiver,
1005 lookup->holder(), 1005 lookup->holder(),
1006 lookup->GetFieldIndex()); 1006 lookup->GetFieldIndex());
1007 break; 1007 break;
1008 } 1008 }
1009 case CONSTANT_FUNCTION: { 1009 case CONSTANT_FUNCTION: {
1010 Object* constant = lookup->GetConstantFunction(); 1010 JSFunction* constant = lookup->GetConstantFunction();
1011 maybe_code = isolate()->stub_cache()->ComputeLoadConstant( 1011 maybe_code = isolate()->stub_cache()->ComputeLoadConstant(
1012 *name, *receiver, lookup->holder(), constant); 1012 *name, *receiver, lookup->holder(), constant);
1013 break; 1013 break;
1014 } 1014 }
1015 case NORMAL: { 1015 case NORMAL: {
1016 if (lookup->holder()->IsGlobalObject()) { 1016 if (lookup->holder()->IsGlobalObject()) {
1017 GlobalObject* global = GlobalObject::cast(lookup->holder()); 1017 GlobalObject* global = GlobalObject::cast(lookup->holder());
1018 JSGlobalPropertyCell* cell = 1018 JSGlobalPropertyCell* cell =
1019 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup)); 1019 JSGlobalPropertyCell::cast(global->GetPropertyCell(lookup));
1020 maybe_code = isolate()->stub_cache()->ComputeLoadGlobal(*name, 1020 maybe_code = isolate()->stub_cache()->ComputeLoadGlobal(*name,
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 maybe_code = pre_monomorphic_stub(); 1284 maybe_code = pre_monomorphic_stub();
1285 } else { 1285 } else {
1286 // Compute a monomorphic stub. 1286 // Compute a monomorphic stub.
1287 switch (lookup->type()) { 1287 switch (lookup->type()) {
1288 case FIELD: { 1288 case FIELD: {
1289 maybe_code = isolate()->stub_cache()->ComputeKeyedLoadField( 1289 maybe_code = isolate()->stub_cache()->ComputeKeyedLoadField(
1290 *name, *receiver, lookup->holder(), lookup->GetFieldIndex()); 1290 *name, *receiver, lookup->holder(), lookup->GetFieldIndex());
1291 break; 1291 break;
1292 } 1292 }
1293 case CONSTANT_FUNCTION: { 1293 case CONSTANT_FUNCTION: {
1294 Object* constant = lookup->GetConstantFunction(); 1294 JSFunction* constant = lookup->GetConstantFunction();
1295 maybe_code = isolate()->stub_cache()->ComputeKeyedLoadConstant( 1295 maybe_code = isolate()->stub_cache()->ComputeKeyedLoadConstant(
1296 *name, *receiver, lookup->holder(), constant); 1296 *name, *receiver, lookup->holder(), constant);
1297 break; 1297 break;
1298 } 1298 }
1299 case CALLBACKS: { 1299 case CALLBACKS: {
1300 if (!lookup->GetCallbackObject()->IsAccessorInfo()) return; 1300 if (!lookup->GetCallbackObject()->IsAccessorInfo()) return;
1301 AccessorInfo* callback = 1301 AccessorInfo* callback =
1302 AccessorInfo::cast(lookup->GetCallbackObject()); 1302 AccessorInfo::cast(lookup->GetCallbackObject());
1303 if (v8::ToCData<Address>(callback->getter()) == 0) return; 1303 if (v8::ToCData<Address>(callback->getter()) == 0) return;
1304 maybe_code = isolate()->stub_cache()->ComputeKeyedLoadCallback( 1304 maybe_code = isolate()->stub_cache()->ComputeKeyedLoadCallback(
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2508 #undef ADDR 2508 #undef ADDR
2509 }; 2509 };
2510 2510
2511 2511
2512 Address IC::AddressFromUtilityId(IC::UtilityId id) { 2512 Address IC::AddressFromUtilityId(IC::UtilityId id) {
2513 return IC_utilities[id]; 2513 return IC_utilities[id];
2514 } 2514 }
2515 2515
2516 2516
2517 } } // namespace v8::internal 2517 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698