| OLD | NEW |
| 1 // Copyright 2009 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 void NormalizeProperties(Handle<JSObject> object, | 207 void NormalizeProperties(Handle<JSObject> object, |
| 208 PropertyNormalizationMode mode, | 208 PropertyNormalizationMode mode, |
| 209 int expected_additional_properties) { | 209 int expected_additional_properties) { |
| 210 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), | 210 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), |
| 211 object->NormalizeProperties( | 211 object->NormalizeProperties( |
| 212 mode, | 212 mode, |
| 213 expected_additional_properties)); | 213 expected_additional_properties)); |
| 214 } | 214 } |
| 215 | 215 |
| 216 | 216 |
| 217 void NormalizeElements(Handle<JSObject> object) { | 217 Handle<NumberDictionary> NormalizeElements(Handle<JSObject> object) { |
| 218 CALL_HEAP_FUNCTION_VOID(object->GetIsolate(), | 218 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 219 object->NormalizeElements()); | 219 object->NormalizeElements(), |
| 220 NumberDictionary); |
| 220 } | 221 } |
| 221 | 222 |
| 222 | 223 |
| 223 void TransformToFastProperties(Handle<JSObject> object, | 224 void TransformToFastProperties(Handle<JSObject> object, |
| 224 int unused_property_fields) { | 225 int unused_property_fields) { |
| 225 CALL_HEAP_FUNCTION_VOID( | 226 CALL_HEAP_FUNCTION_VOID( |
| 226 object->GetIsolate(), | 227 object->GetIsolate(), |
| 227 object->TransformToFastProperties(unused_property_fields)); | 228 object->TransformToFastProperties(unused_property_fields)); |
| 228 } | 229 } |
| 229 | 230 |
| 230 | 231 |
| 231 void NumberDictionarySet(Handle<NumberDictionary> dictionary, | 232 Handle<NumberDictionary> NumberDictionarySet( |
| 232 uint32_t index, | 233 Handle<NumberDictionary> dictionary, |
| 233 Handle<Object> value, | 234 uint32_t index, |
| 234 PropertyDetails details) { | 235 Handle<Object> value, |
| 235 CALL_HEAP_FUNCTION_VOID(dictionary->GetIsolate(), | 236 PropertyDetails details) { |
| 236 dictionary->Set(index, *value, details)); | 237 CALL_HEAP_FUNCTION(dictionary->GetIsolate(), |
| 238 dictionary->Set(index, *value, details), |
| 239 NumberDictionary); |
| 237 } | 240 } |
| 238 | 241 |
| 239 | 242 |
| 240 void FlattenString(Handle<String> string) { | 243 void FlattenString(Handle<String> string) { |
| 241 CALL_HEAP_FUNCTION_VOID(string->GetIsolate(), string->TryFlatten()); | 244 CALL_HEAP_FUNCTION_VOID(string->GetIsolate(), string->TryFlatten()); |
| 242 } | 245 } |
| 243 | 246 |
| 244 | 247 |
| 245 Handle<String> FlattenGetString(Handle<String> string) { | 248 Handle<String> FlattenGetString(Handle<String> string) { |
| 246 CALL_HEAP_FUNCTION(string->GetIsolate(), string->TryFlatten(), String); | 249 CALL_HEAP_FUNCTION(string->GetIsolate(), string->TryFlatten(), String); |
| 247 } | 250 } |
| 248 | 251 |
| 249 | 252 |
| 250 Handle<Object> SetPrototype(Handle<JSFunction> function, | 253 Handle<Object> SetPrototype(Handle<JSFunction> function, |
| 251 Handle<Object> prototype) { | 254 Handle<Object> prototype) { |
| 252 ASSERT(function->should_have_prototype()); | 255 ASSERT(function->should_have_prototype()); |
| 253 CALL_HEAP_FUNCTION(function->GetIsolate(), | 256 CALL_HEAP_FUNCTION(function->GetIsolate(), |
| 254 Accessors::FunctionSetPrototype(*function, | 257 Accessors::FunctionSetPrototype(*function, |
| 255 *prototype, | 258 *prototype, |
| 256 NULL), | 259 NULL), |
| 257 Object); | 260 Object); |
| 258 } | 261 } |
| 259 | 262 |
| 260 | 263 |
| 261 Handle<Object> SetProperty(Handle<JSObject> object, | 264 Handle<Object> SetProperty(Handle<JSReceiver> object, |
| 262 Handle<String> key, | 265 Handle<String> key, |
| 263 Handle<Object> value, | 266 Handle<Object> value, |
| 264 PropertyAttributes attributes, | 267 PropertyAttributes attributes, |
| 265 StrictModeFlag strict_mode) { | 268 StrictModeFlag strict_mode) { |
| 266 CALL_HEAP_FUNCTION(object->GetIsolate(), | 269 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 267 object->SetProperty(*key, *value, attributes, strict_mode), | 270 object->SetProperty(*key, *value, attributes, strict_mode), |
| 268 Object); | 271 Object); |
| 269 } | 272 } |
| 270 | 273 |
| 271 | 274 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 StrictModeFlag strict_mode) { | 349 StrictModeFlag strict_mode) { |
| 347 CALL_HEAP_FUNCTION(object->GetIsolate(), | 350 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 348 object->SetPropertyWithInterceptor(*key, | 351 object->SetPropertyWithInterceptor(*key, |
| 349 *value, | 352 *value, |
| 350 attributes, | 353 attributes, |
| 351 strict_mode), | 354 strict_mode), |
| 352 Object); | 355 Object); |
| 353 } | 356 } |
| 354 | 357 |
| 355 | 358 |
| 356 Handle<Object> GetProperty(Handle<JSObject> obj, | 359 Handle<Object> GetProperty(Handle<JSReceiver> obj, |
| 357 const char* name) { | 360 const char* name) { |
| 358 Isolate* isolate = obj->GetIsolate(); | 361 Isolate* isolate = obj->GetIsolate(); |
| 359 Handle<String> str = isolate->factory()->LookupAsciiSymbol(name); | 362 Handle<String> str = isolate->factory()->LookupAsciiSymbol(name); |
| 360 CALL_HEAP_FUNCTION(isolate, obj->GetProperty(*str), Object); | 363 CALL_HEAP_FUNCTION(isolate, obj->GetProperty(*str), Object); |
| 361 } | 364 } |
| 362 | 365 |
| 363 | 366 |
| 364 Handle<Object> GetProperty(Handle<Object> obj, | 367 Handle<Object> GetProperty(Handle<Object> obj, |
| 365 const char* name, | |
| 366 LookupResult* result) { | |
| 367 Isolate* isolate = Isolate::Current(); | |
| 368 Handle<String> str = isolate->factory()->LookupAsciiSymbol(name); | |
| 369 PropertyAttributes attributes; | |
| 370 CALL_HEAP_FUNCTION( | |
| 371 isolate, obj->GetProperty(*obj, result, *str, &attributes), Object); | |
| 372 } | |
| 373 | |
| 374 | |
| 375 Handle<Object> GetProperty(Handle<Object> obj, | |
| 376 Handle<Object> key) { | 368 Handle<Object> key) { |
| 377 Isolate* isolate = Isolate::Current(); | 369 Isolate* isolate = Isolate::Current(); |
| 378 CALL_HEAP_FUNCTION(isolate, | 370 CALL_HEAP_FUNCTION(isolate, |
| 379 Runtime::GetObjectProperty(isolate, obj, key), Object); | 371 Runtime::GetObjectProperty(isolate, obj, key), Object); |
| 380 } | 372 } |
| 381 | 373 |
| 382 | 374 |
| 383 Handle<Object> GetProperty(Handle<JSObject> obj, | 375 Handle<Object> GetProperty(Handle<JSReceiver> obj, |
| 384 Handle<String> name, | 376 Handle<String> name, |
| 385 LookupResult* result) { | 377 LookupResult* result) { |
| 386 PropertyAttributes attributes; | 378 PropertyAttributes attributes; |
| 387 Isolate* isolate = Isolate::Current(); | 379 Isolate* isolate = Isolate::Current(); |
| 388 CALL_HEAP_FUNCTION(isolate, | 380 CALL_HEAP_FUNCTION(isolate, |
| 389 obj->GetProperty(*obj, result, *name, &attributes), | 381 obj->GetProperty(*obj, result, *name, &attributes), |
| 390 Object); | 382 Object); |
| 391 } | 383 } |
| 392 | 384 |
| 393 | 385 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 StrictModeFlag strict_mode) { | 501 StrictModeFlag strict_mode) { |
| 510 if (object->HasExternalArrayElements()) { | 502 if (object->HasExternalArrayElements()) { |
| 511 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { | 503 if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) { |
| 512 bool has_exception; | 504 bool has_exception; |
| 513 Handle<Object> number = Execution::ToNumber(value, &has_exception); | 505 Handle<Object> number = Execution::ToNumber(value, &has_exception); |
| 514 if (has_exception) return Handle<Object>(); | 506 if (has_exception) return Handle<Object>(); |
| 515 value = number; | 507 value = number; |
| 516 } | 508 } |
| 517 } | 509 } |
| 518 CALL_HEAP_FUNCTION(object->GetIsolate(), | 510 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 519 object->SetElement(index, *value, strict_mode), Object); | 511 object->SetElement(index, *value, strict_mode, true), |
| 512 Object); |
| 520 } | 513 } |
| 521 | 514 |
| 522 | 515 |
| 523 Handle<Object> SetOwnElement(Handle<JSObject> object, | 516 Handle<Object> SetOwnElement(Handle<JSObject> object, |
| 524 uint32_t index, | 517 uint32_t index, |
| 525 Handle<Object> value, | 518 Handle<Object> value, |
| 526 StrictModeFlag strict_mode) { | 519 StrictModeFlag strict_mode) { |
| 527 ASSERT(!object->HasExternalArrayElements()); | 520 ASSERT(!object->HasExternalArrayElements()); |
| 528 CALL_HEAP_FUNCTION(object->GetIsolate(), | 521 CALL_HEAP_FUNCTION(object->GetIsolate(), |
| 529 object->SetElement(index, *value, strict_mode, false), | 522 object->SetElement(index, *value, strict_mode, false), |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 | 971 |
| 979 bool CompileOptimized(Handle<JSFunction> function, | 972 bool CompileOptimized(Handle<JSFunction> function, |
| 980 int osr_ast_id, | 973 int osr_ast_id, |
| 981 ClearExceptionFlag flag) { | 974 ClearExceptionFlag flag) { |
| 982 CompilationInfo info(function); | 975 CompilationInfo info(function); |
| 983 info.SetOptimizing(osr_ast_id); | 976 info.SetOptimizing(osr_ast_id); |
| 984 return CompileLazyHelper(&info, flag); | 977 return CompileLazyHelper(&info, flag); |
| 985 } | 978 } |
| 986 | 979 |
| 987 } } // namespace v8::internal | 980 } } // namespace v8::internal |
| OLD | NEW |