~ubuntu-branches/ubuntu/saucy/libv8/saucy

« back to all changes in this revision

Viewing changes to src/handles.cc

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-04-07 16:26:13 UTC
  • mfrom: (15.1.27 sid)
  • Revision ID: package-import@ubuntu.com-20120407162613-dqo1m6w9r3fh8tst
Tags: 3.8.9.16-3
* mipsel build fixes :
  + v8_use_mips_abi_hardfloat=false, this lowers EABI requirements.
  + v8_can_use_fpu_instructions=false, detect if FPU is present.
  + set -Wno-unused-but-set-variable only on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
}
209
209
 
210
210
 
211
 
void NormalizeProperties(Handle<JSObject> object,
212
 
                         PropertyNormalizationMode mode,
213
 
                         int expected_additional_properties) {
214
 
  CALL_HEAP_FUNCTION_VOID(object->GetIsolate(),
215
 
                          object->NormalizeProperties(
216
 
                              mode,
217
 
                              expected_additional_properties));
218
 
}
219
 
 
220
 
 
221
 
Handle<NumberDictionary> NormalizeElements(Handle<JSObject> object) {
222
 
  CALL_HEAP_FUNCTION(object->GetIsolate(),
223
 
                     object->NormalizeElements(),
224
 
                     NumberDictionary);
225
 
}
226
 
 
227
 
 
228
 
void TransformToFastProperties(Handle<JSObject> object,
229
 
                               int unused_property_fields) {
230
 
  CALL_HEAP_FUNCTION_VOID(
231
 
      object->GetIsolate(),
232
 
      object->TransformToFastProperties(unused_property_fields));
233
 
}
234
 
 
235
 
 
236
 
Handle<NumberDictionary> NumberDictionarySet(
237
 
    Handle<NumberDictionary> dictionary,
238
 
    uint32_t index,
239
 
    Handle<Object> value,
240
 
    PropertyDetails details) {
241
 
  CALL_HEAP_FUNCTION(dictionary->GetIsolate(),
242
 
                     dictionary->Set(index, *value, details),
243
 
                     NumberDictionary);
244
 
}
245
 
 
246
 
 
247
211
void FlattenString(Handle<String> string) {
248
212
  CALL_HEAP_FUNCTION_VOID(string->GetIsolate(), string->TryFlatten());
249
213
}
265
229
}
266
230
 
267
231
 
268
 
Handle<Object> SetProperty(Handle<JSReceiver> object,
269
 
                           Handle<String> key,
270
 
                           Handle<Object> value,
271
 
                           PropertyAttributes attributes,
272
 
                           StrictModeFlag strict_mode) {
273
 
  CALL_HEAP_FUNCTION(object->GetIsolate(),
274
 
                     object->SetProperty(*key, *value, attributes, strict_mode),
275
 
                     Object);
276
 
}
277
 
 
278
 
 
279
232
Handle<Object> SetProperty(Handle<Object> object,
280
233
                           Handle<Object> key,
281
234
                           Handle<Object> value,
303
256
}
304
257
 
305
258
 
306
 
Handle<Object> SetNormalizedProperty(Handle<JSObject> object,
307
 
                                     Handle<String> key,
308
 
                                     Handle<Object> value,
309
 
                                     PropertyDetails details) {
310
 
  CALL_HEAP_FUNCTION(object->GetIsolate(),
311
 
                     object->SetNormalizedProperty(*key, *value, details),
312
 
                     Object);
313
 
}
314
 
 
315
 
 
316
259
Handle<Object> ForceDeleteProperty(Handle<JSObject> object,
317
260
                                   Handle<Object> key) {
318
261
  Isolate* isolate = object->GetIsolate();
322
265
}
323
266
 
324
267
 
325
 
Handle<Object> SetLocalPropertyIgnoreAttributes(
326
 
    Handle<JSObject> object,
327
 
    Handle<String> key,
328
 
    Handle<Object> value,
329
 
    PropertyAttributes attributes) {
330
 
  CALL_HEAP_FUNCTION(
331
 
    object->GetIsolate(),
332
 
    object->SetLocalPropertyIgnoreAttributes(*key, *value, attributes),
333
 
    Object);
334
 
}
335
 
 
336
 
 
337
 
void SetLocalPropertyNoThrow(Handle<JSObject> object,
338
 
                             Handle<String> key,
339
 
                             Handle<Object> value,
340
 
                             PropertyAttributes attributes) {
341
 
  Isolate* isolate = object->GetIsolate();
342
 
  ASSERT(!isolate->has_pending_exception());
343
 
  CHECK(!SetLocalPropertyIgnoreAttributes(
344
 
        object, key, value, attributes).is_null());
345
 
  CHECK(!isolate->has_pending_exception());
346
 
}
347
 
 
348
 
 
349
268
Handle<Object> SetPropertyWithInterceptor(Handle<JSObject> object,
350
269
                                          Handle<String> key,
351
270
                                          Handle<Object> value,
389
308
}
390
309
 
391
310
 
392
 
Handle<Object> GetPrototype(Handle<Object> obj) {
393
 
  Handle<Object> result(obj->GetPrototype());
394
 
  return result;
395
 
}
396
 
 
397
 
 
398
311
Handle<Object> SetPrototype(Handle<JSObject> obj, Handle<Object> value) {
399
312
  const bool skip_hidden_prototypes = false;
400
313
  CALL_HEAP_FUNCTION(obj->GetIsolate(),
402
315
}
403
316
 
404
317
 
405
 
Handle<Object> PreventExtensions(Handle<JSObject> object) {
406
 
  CALL_HEAP_FUNCTION(object->GetIsolate(), object->PreventExtensions(), Object);
407
 
}
408
 
 
409
 
 
410
 
Handle<Object> SetHiddenProperty(Handle<JSObject> obj,
411
 
                                 Handle<String> key,
412
 
                                 Handle<Object> value) {
413
 
  CALL_HEAP_FUNCTION(obj->GetIsolate(),
414
 
                     obj->SetHiddenProperty(*key, *value),
415
 
                     Object);
416
 
}
417
 
 
418
 
 
419
 
int GetIdentityHash(Handle<JSReceiver> obj) {
420
 
  CALL_AND_RETRY(obj->GetIsolate(),
421
 
                 obj->GetIdentityHash(ALLOW_CREATION),
422
 
                 return Smi::cast(__object__)->value(),
423
 
                 return 0);
424
 
}
425
 
 
426
 
 
427
 
Handle<Object> DeleteElement(Handle<JSObject> obj,
428
 
                             uint32_t index) {
429
 
  CALL_HEAP_FUNCTION(obj->GetIsolate(),
430
 
                     obj->DeleteElement(index, JSObject::NORMAL_DELETION),
431
 
                     Object);
432
 
}
433
 
 
434
 
 
435
 
Handle<Object> DeleteProperty(Handle<JSObject> obj,
436
 
                              Handle<String> prop) {
437
 
  CALL_HEAP_FUNCTION(obj->GetIsolate(),
438
 
                     obj->DeleteProperty(*prop, JSObject::NORMAL_DELETION),
439
 
                     Object);
440
 
}
441
 
 
442
 
 
443
318
Handle<Object> LookupSingleCharacterStringFromCode(uint32_t index) {
444
319
  Isolate* isolate = Isolate::Current();
445
320
  CALL_HEAP_FUNCTION(
457
332
}
458
333
 
459
334
 
460
 
Handle<Object> SetElement(Handle<JSObject> object,
461
 
                          uint32_t index,
462
 
                          Handle<Object> value,
463
 
                          StrictModeFlag strict_mode) {
464
 
  if (object->HasExternalArrayElements()) {
465
 
    if (!value->IsSmi() && !value->IsHeapNumber() && !value->IsUndefined()) {
466
 
      bool has_exception;
467
 
      Handle<Object> number = Execution::ToNumber(value, &has_exception);
468
 
      if (has_exception) return Handle<Object>();
469
 
      value = number;
470
 
    }
471
 
  }
472
 
  CALL_HEAP_FUNCTION(object->GetIsolate(),
473
 
                     object->SetElement(index, *value, strict_mode, true),
474
 
                     Object);
475
 
}
476
 
 
477
 
 
478
 
Handle<Object> SetOwnElement(Handle<JSObject> object,
479
 
                             uint32_t index,
480
 
                             Handle<Object> value,
481
 
                             StrictModeFlag strict_mode) {
482
 
  ASSERT(!object->HasExternalArrayElements());
483
 
  CALL_HEAP_FUNCTION(object->GetIsolate(),
484
 
                     object->SetElement(index, *value, strict_mode, false),
485
 
                     Object);
486
 
}
487
 
 
488
 
 
489
 
Handle<Object> TransitionElementsKind(Handle<JSObject> object,
490
 
                                      ElementsKind to_kind) {
491
 
  CALL_HEAP_FUNCTION(object->GetIsolate(),
492
 
                     object->TransitionElementsKind(to_kind),
493
 
                     Object);
494
 
}
495
 
 
496
 
 
497
335
Handle<JSObject> Copy(Handle<JSObject> obj) {
498
336
  Isolate* isolate = obj->GetIsolate();
499
337
  CALL_HEAP_FUNCTION(isolate,