OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 int FunctionLiteral::end_position() const { | 179 int FunctionLiteral::end_position() const { |
180 return scope()->end_position(); | 180 return scope()->end_position(); |
181 } | 181 } |
182 | 182 |
183 | 183 |
184 LanguageMode FunctionLiteral::language_mode() const { | 184 LanguageMode FunctionLiteral::language_mode() const { |
185 return scope()->language_mode(); | 185 return scope()->language_mode(); |
186 } | 186 } |
187 | 187 |
188 | 188 |
| 189 void FunctionLiteral::InitializeSharedInfo( |
| 190 Handle<Code> unoptimized_code) { |
| 191 for (RelocIterator it(*unoptimized_code); !it.done(); it.next()) { |
| 192 RelocInfo* rinfo = it.rinfo(); |
| 193 if (rinfo->rmode() != RelocInfo::EMBEDDED_OBJECT) continue; |
| 194 Object* obj = rinfo->target_object(); |
| 195 if (obj->IsSharedFunctionInfo()) { |
| 196 SharedFunctionInfo* shared = SharedFunctionInfo::cast(obj); |
| 197 if (shared->start_position() == start_position()) { |
| 198 shared_info_ = Handle<SharedFunctionInfo>(shared); |
| 199 break; |
| 200 } |
| 201 } |
| 202 } |
| 203 } |
| 204 |
| 205 |
189 ObjectLiteralProperty::ObjectLiteralProperty(Literal* key, | 206 ObjectLiteralProperty::ObjectLiteralProperty(Literal* key, |
190 Expression* value, | 207 Expression* value, |
191 Isolate* isolate) { | 208 Isolate* isolate) { |
192 emit_store_ = true; | 209 emit_store_ = true; |
193 key_ = key; | 210 key_ = key; |
194 value_ = value; | 211 value_ = value; |
195 Object* k = *key->value(); | 212 Object* k = *key->value(); |
196 if (k->IsInternalizedString() && | 213 if (k->IsInternalizedString() && |
197 isolate->heap()->proto_string()->Equals(String::cast(k))) { | 214 isolate->heap()->proto_string()->Equals(String::cast(k))) { |
198 kind_ = PROTOTYPE; | 215 kind_ = PROTOTYPE; |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); | 1262 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); |
1246 str = arr; | 1263 str = arr; |
1247 } else { | 1264 } else { |
1248 str = DoubleToCString(value_->Number(), buffer); | 1265 str = DoubleToCString(value_->Number(), buffer); |
1249 } | 1266 } |
1250 return isolate_->factory()->NewStringFromAscii(CStrVector(str)); | 1267 return isolate_->factory()->NewStringFromAscii(CStrVector(str)); |
1251 } | 1268 } |
1252 | 1269 |
1253 | 1270 |
1254 } } // namespace v8::internal | 1271 } } // namespace v8::internal |
OLD | NEW |