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

Side by Side Diff: src/apinatives.js

Issue 155405: Convert object to fast mode after creation. That enables more optimizations.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 5 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 | « no previous file | 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 function Instantiate(data, name) { 44 function Instantiate(data, name) {
45 if (!%IsTemplate(data)) return data; 45 if (!%IsTemplate(data)) return data;
46 var tag = %GetTemplateField(data, kApiTagOffset); 46 var tag = %GetTemplateField(data, kApiTagOffset);
47 switch (tag) { 47 switch (tag) {
48 case kFunctionTag: 48 case kFunctionTag:
49 return InstantiateFunction(data, name); 49 return InstantiateFunction(data, name);
50 case kNewObjectTag: 50 case kNewObjectTag:
51 var Constructor = %GetTemplateField(data, kApiConstructorOffset); 51 var Constructor = %GetTemplateField(data, kApiConstructorOffset);
52 var result = Constructor ? new (Instantiate(Constructor))() : {}; 52 var result = Constructor ? new (Instantiate(Constructor))() : {};
53 ConfigureTemplateInstance(result, data); 53 ConfigureTemplateInstance(result, data);
54 result = %ToFastProperties(result);
54 return result; 55 return result;
55 default: 56 default:
56 throw 'Unknown API tag <' + tag + '>'; 57 throw 'Unknown API tag <' + tag + '>';
57 } 58 }
58 } 59 }
59 60
60 61
61 function InstantiateFunction(data, name) { 62 function InstantiateFunction(data, name) {
62 // We need a reference to kApiFunctionCache in the stack frame 63 // We need a reference to kApiFunctionCache in the stack frame
63 // if we need to bail out from a stack overflow. 64 // if we need to bail out from a stack overflow.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 var prop_data = properties[i + 2]; 101 var prop_data = properties[i + 2];
101 var attributes = properties[i + 3]; 102 var attributes = properties[i + 3];
102 var value = Instantiate(prop_data, name); 103 var value = Instantiate(prop_data, name);
103 %SetProperty(obj, name, value, attributes); 104 %SetProperty(obj, name, value, attributes);
104 } 105 }
105 } finally { 106 } finally {
106 if (requires_access_checks) %EnableAccessChecks(obj); 107 if (requires_access_checks) %EnableAccessChecks(obj);
107 } 108 }
108 } 109 }
109 } 110 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698