| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 4566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4577 if (key->AsArrayIndex(&index)) { | 4577 if (key->AsArrayIndex(&index)) { |
| 4578 if (index < n) { | 4578 if (index < n) { |
| 4579 return frame->GetParameter(index); | 4579 return frame->GetParameter(index); |
| 4580 } else { | 4580 } else { |
| 4581 return isolate->initial_object_prototype()->GetElement(index); | 4581 return isolate->initial_object_prototype()->GetElement(index); |
| 4582 } | 4582 } |
| 4583 } | 4583 } |
| 4584 | 4584 |
| 4585 // Handle special arguments properties. | 4585 // Handle special arguments properties. |
| 4586 if (key->Equals(isolate->heap()->length_symbol())) return Smi::FromInt(n); | 4586 if (key->Equals(isolate->heap()->length_symbol())) return Smi::FromInt(n); |
| 4587 if (key->Equals(isolate->heap()->callee_symbol())) return frame->function(); | 4587 if (key->Equals(isolate->heap()->callee_symbol())) { |
| 4588 Object* function = frame->function(); |
| 4589 if (function->IsJSFunction() && |
| 4590 JSFunction::cast(function)->shared()->strict_mode()) { |
| 4591 return isolate->Throw(*isolate->factory()->NewTypeError( |
| 4592 "strict_arguments_callee", HandleVector<Object>(NULL, 0))); |
| 4593 } |
| 4594 return function; |
| 4595 } |
| 4588 | 4596 |
| 4589 // Lookup in the initial Object.prototype object. | 4597 // Lookup in the initial Object.prototype object. |
| 4590 return isolate->initial_object_prototype()->GetProperty(*key); | 4598 return isolate->initial_object_prototype()->GetProperty(*key); |
| 4591 } | 4599 } |
| 4592 | 4600 |
| 4593 | 4601 |
| 4594 static MaybeObject* Runtime_ToFastProperties(RUNTIME_CALLING_CONVENTION) { | 4602 static MaybeObject* Runtime_ToFastProperties(RUNTIME_CALLING_CONVENTION) { |
| 4595 RUNTIME_GET_ISOLATE; | 4603 RUNTIME_GET_ISOLATE; |
| 4596 HandleScope scope(isolate); | 4604 HandleScope scope(isolate); |
| 4597 | 4605 |
| (...skipping 3804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8402 static MaybeObject* Runtime_SetNewFunctionAttributes( | 8410 static MaybeObject* Runtime_SetNewFunctionAttributes( |
| 8403 RUNTIME_CALLING_CONVENTION) { | 8411 RUNTIME_CALLING_CONVENTION) { |
| 8404 RUNTIME_GET_ISOLATE; | 8412 RUNTIME_GET_ISOLATE; |
| 8405 // This utility adjusts the property attributes for newly created Function | 8413 // This utility adjusts the property attributes for newly created Function |
| 8406 // object ("new Function(...)") by changing the map. | 8414 // object ("new Function(...)") by changing the map. |
| 8407 // All it does is changing the prototype property to enumerable | 8415 // All it does is changing the prototype property to enumerable |
| 8408 // as specified in ECMA262, 15.3.5.2. | 8416 // as specified in ECMA262, 15.3.5.2. |
| 8409 HandleScope scope(isolate); | 8417 HandleScope scope(isolate); |
| 8410 ASSERT(args.length() == 1); | 8418 ASSERT(args.length() == 1); |
| 8411 CONVERT_ARG_CHECKED(JSFunction, func, 0); | 8419 CONVERT_ARG_CHECKED(JSFunction, func, 0); |
| 8412 ASSERT(func->map()->instance_type() == | 8420 |
| 8413 isolate->function_instance_map()->instance_type()); | 8421 Handle<Map> map = func->shared()->strict_mode() |
| 8414 ASSERT(func->map()->instance_size() == | 8422 ? isolate->strict_mode_function_instance_map() |
| 8415 isolate->function_instance_map()->instance_size()); | 8423 : isolate->function_instance_map(); |
| 8416 func->set_map(*isolate->function_instance_map()); | 8424 |
| 8425 ASSERT(func->map()->instance_type() == map->instance_type()); |
| 8426 ASSERT(func->map()->instance_size() == map->instance_size()); |
| 8427 func->set_map(*map); |
| 8417 return *func; | 8428 return *func; |
| 8418 } | 8429 } |
| 8419 | 8430 |
| 8420 | 8431 |
| 8421 static MaybeObject* Runtime_AllocateInNewSpace(RUNTIME_CALLING_CONVENTION) { | 8432 static MaybeObject* Runtime_AllocateInNewSpace(RUNTIME_CALLING_CONVENTION) { |
| 8422 RUNTIME_GET_ISOLATE; | 8433 RUNTIME_GET_ISOLATE; |
| 8423 // Allocate a block of memory in NewSpace (filled with a filler). | 8434 // Allocate a block of memory in NewSpace (filled with a filler). |
| 8424 // Use as fallback for allocation in generated code when NewSpace | 8435 // Use as fallback for allocation in generated code when NewSpace |
| 8425 // is full. | 8436 // is full. |
| 8426 ASSERT(args.length() == 1); | 8437 ASSERT(args.length() == 1); |
| (...skipping 3745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12172 } else { | 12183 } else { |
| 12173 // Handle last resort GC and make sure to allow future allocations | 12184 // Handle last resort GC and make sure to allow future allocations |
| 12174 // to grow the heap without causing GCs (if possible). | 12185 // to grow the heap without causing GCs (if possible). |
| 12175 COUNTERS->gc_last_resort_from_js()->Increment(); | 12186 COUNTERS->gc_last_resort_from_js()->Increment(); |
| 12176 HEAP->CollectAllGarbage(false); | 12187 HEAP->CollectAllGarbage(false); |
| 12177 } | 12188 } |
| 12178 } | 12189 } |
| 12179 | 12190 |
| 12180 | 12191 |
| 12181 } } // namespace v8::internal | 12192 } } // namespace v8::internal |
| OLD | NEW |